Add command line option to suppress dialogs

Implement a -q/--quiet command line option to disable system dialogs
temporarily.

Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
Lukas Fleischer
2016-01-12 18:29:26 +01:00
parent 6d9129764b
commit c58087d591
6 changed files with 20 additions and 6 deletions

View File

@@ -459,7 +459,7 @@ int parse_args(int argc, char **argv)
int ch;
regex_t reg;
static const char *optstr = "FgGhvnNax::t::d:c:r::s::S:D:i:l:Q";
static const char *optstr = "FgGhvnNax::t::d:c:r::s::S:D:i:l:qQ";
struct option longopts[] = {
{"appointment", no_argument, NULL, 'a'},
@@ -480,6 +480,7 @@ int parse_args(int argc, char **argv)
{"todo", optional_argument, NULL, 't'},
{"version", no_argument, NULL, 'v'},
{"export", optional_argument, NULL, 'x'},
{"quiet", no_argument, NULL, 'q'},
{"query", optional_argument, NULL, 'Q'},
{"filter-type", required_argument, NULL, OPT_FILTER_TYPE},
@@ -602,6 +603,9 @@ int parse_args(int argc, char **argv)
optarg);
}
break;
case 'q':
quiet = 1;
break;
case 'Q':
query = 1;
break;