From 03bfe1015e7e67104c2872bdcf085b1315b24a4c Mon Sep 17 00:00:00 2001 From: Bert Date: Sun, 30 Jan 2011 16:39:16 +0100 Subject: Explicitly enable printing of warnings --- options.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index b0f3186..1bcfbe1 100644 --- a/options.c +++ b/options.c @@ -29,7 +29,7 @@ options_t _options; const options_t *options = (const options_t*) &_options; void print_usage() { - printf("usage: sxiv [-dfhpsvZ] [-w WIDTH[xHEIGHT]] [-z ZOOM] FILES...\n"); + printf("usage: sxiv [-dfhpsvWZ] [-w WIDTH[xHEIGHT]] [-z ZOOM] FILES...\n"); } void print_version() { @@ -50,7 +50,9 @@ void parse_options(int argc, char **argv) { _options.winh = h = 0; _options.fullscreen = 0; - while ((opt = getopt(argc, argv, "dfhpsvw:Zz:")) != -1) { + _options.warn = 0; + + while ((opt = getopt(argc, argv, "dfhpsvWw:Zz:")) != -1) { switch (opt) { case '?': print_usage(); @@ -73,6 +75,9 @@ void parse_options(int argc, char **argv) { case 'v': print_version(); exit(0); + case 'W': + _options.warn = 1; + break; case 'w': if (!sscanf(optarg, "%hux%hu", &w, &h)) { fprintf(stderr, "sxiv: invalid argument for option -w: %s\n", -- cgit v1.2.3-54-g00ecf