From 510512714df01110cf42cb2a11d944f55297c5cc Mon Sep 17 00:00:00 2001 From: Bert Date: Sat, 10 Sep 2011 18:41:20 +0200 Subject: Added slideshow support --- options.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'options.c') diff --git a/options.c b/options.c index 8532be1..1e4a56c 100644 --- a/options.c +++ b/options.c @@ -54,23 +54,22 @@ void print_version() { } void parse_options(int argc, char **argv) { - float z; - int n, opt; + int opt, t; + _options.recursive = 0; _options.startnum = 0; _options.scalemode = SCALE_MODE; _options.zoom = 1.0; _options.aa = 1; - _options.thumbnails = 0; _options.fixed = 0; _options.fullscreen = 0; _options.geometry = NULL; _options.quiet = 0; + _options.thumbnails = 0; _options.clean_cache = 0; - _options.recursive = 0; while ((opt = getopt(argc, argv, "cdFfg:hn:pqrstvZz:")) != -1) { switch (opt) { @@ -96,12 +95,12 @@ void parse_options(int argc, char **argv) { print_usage(); exit(0); case 'n': - if (!sscanf(optarg, "%d", &n) || n < 1) { + if (!sscanf(optarg, "%d", &t) || t < 1) { fprintf(stderr, "sxiv: invalid argument for option -n: %s\n", optarg); exit(1); } else { - _options.startnum = n - 1; + _options.startnum = t - 1; } break; case 'p': @@ -128,12 +127,12 @@ void parse_options(int argc, char **argv) { break; case 'z': _options.scalemode = SCALE_ZOOM; - if (!sscanf(optarg, "%f", &z) || z < 0) { + if (!sscanf(optarg, "%d", &t) || t <= 0) { fprintf(stderr, "sxiv: invalid argument for option -z: %s\n", optarg); exit(1); } - _options.zoom = z / 100.0; + _options.zoom = (float) t / 100.0; break; } } -- cgit v1.2.3