summaryrefslogtreecommitdiff
path: root/src/options.c
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2017-12-28 17:19:35 +0100
committerDaniel Friesel <derf@finalrewind.org>2017-12-28 17:19:35 +0100
commit51dc926c302cebcede32843e84641407189b3df9 (patch)
treea7d7f62d3ebca4ea623414b0e7a9e4248a04e569 /src/options.c
parent51ed4f02a56ac292a95f4347fbd0d385335a239c (diff)
parent0a006ed6767e42bbc1608400faf0fa9e008ff49c (diff)
Merge branch 'cache-size-option' of https://github.com/ulteq/feh into ulteq-cache-size-option
Diffstat (limited to 'src/options.c')
-rw-r--r--src/options.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/options.c b/src/options.c
index 1ed5b54..c874832 100644
--- a/src/options.c
+++ b/src/options.c
@@ -68,6 +68,7 @@ void init_parse_options(int argc, char **argv)
opt.jump_on_resort = 1;
opt.screen_clip = 1;
+ opt.cache_size = 4;
#ifdef HAVE_LIBXINERAMA
/* if we're using xinerama, then enable it by default */
opt.xinerama = 1;
@@ -410,6 +411,7 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
{"xinerama-index", 1, 0, 239},
{"insecure" , 0, 0, 240},
{"no-recursive" , 0, 0, 241},
+ {"cache-size" , 1, 0, 243},
{0, 0, 0, 0}
};
int optch = 0, cmdx = 0;
@@ -772,6 +774,14 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun)
break;
case 241:
opt.recursive = 0;
+ break;
+ case 243:
+ opt.cache_size = atoi(optarg);
+ if (opt.cache_size < 0)
+ opt.cache_size = 0;
+ if (opt.cache_size > 2048)
+ opt.cache_size = 2048;
+ break;
default:
break;
}