summaryrefslogtreecommitdiffstats
path: root/options.c
diff options
context:
space:
mode:
authorBert <ber.t@gmx.com>2011-09-10 18:41:20 +0200
committerBert <ber.t@gmx.com>2011-09-10 18:41:20 +0200
commit510512714df01110cf42cb2a11d944f55297c5cc (patch)
tree38a7393df90254e9d89e80c37c9ae4a16eb58b6b /options.c
parent79d780a701e47ea1aacf49728e28900bb2b17743 (diff)
downloadnsxiv-510512714df01110cf42cb2a11d944f55297c5cc.tar.zst
Added slideshow support
Diffstat (limited to 'options.c')
-rw-r--r--options.c15
1 files changed, 7 insertions, 8 deletions
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;
}
}