From 370d475165c2dd25ba2e7dd6553f00f8064ac352 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Droz?= Date: Mon, 3 Dec 2012 14:28:58 +0100 Subject: [PATCH] command-line containing --outformat is less-error prone. Since --convert isn't mandatory anymore for --outformat to be used (what was conflicting with --mutt-query), we removed the call to set_convert_var() in 141acfcc. We now need to test that one of MODE_CONVERT and MODE_QUERY is 'on' before allowing the use of --outformat. $ abook --outformat anyformat < file # won't hang anymore --- abook.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/abook.c b/abook.c index 8521058..dd05b56 100644 --- a/abook.c +++ b/abook.c @@ -377,6 +377,11 @@ parse_command_line(int argc, char **argv) set_convert_var(informat); break; case OPT_OUTFORMAT: + if(mode != MODE_CONVERT && mode != MODE_QUERY) { + fprintf(stderr, + _("please use option --outformat after --convert or --mutt-query option\n")); + exit(EXIT_FAILURE); + } // ascii-name is stored, it's used to traverse // e_filters[] in MODE_CONVERT (see export_file()) outformat = optarg; -- 2.39.2