diff options
Diffstat (limited to 'src/options.c')
-rw-r--r-- | src/options.c | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/src/options.c b/src/options.c index cbeb729..9e2ff5a 100644 --- a/src/options.c +++ b/src/options.c @@ -70,6 +70,7 @@ void init_parse_options(int argc, char **argv) #ifdef HAVE_LIBXINERAMA /* if we're using xinerama, then enable it by default */ opt.xinerama = 1; + opt.xinerama_index = -1; #endif /* HAVE_LIBXINERAMA */ feh_getopt_theme(argc, argv); @@ -404,7 +405,9 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) {"no-fehbg" , 0, 0, 236}, {"keep-zoom-vp" , 0, 0, 237}, {"scroll-step" , 1, 0, 238}, - + {"xinerama-index", 1, 0, 239}, + {"insecure" , 0, 0, 240}, + {"no-recursive" , 0, 0, 241}, {0, 0, 0, 0} }; int optch = 0, cmdx = 0; @@ -511,6 +514,8 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) opt.sort = SORT_NAME; else if (!strcasecmp(optarg, "filename")) opt.sort = SORT_FILENAME; + else if (!strcasecmp(optarg, "dirname")) + opt.sort = SORT_DIRNAME; else if (!strcasecmp(optarg, "mtime")) opt.sort = SORT_MTIME; else if (!strcasecmp(optarg, "width")) @@ -528,6 +533,11 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) "sort by filename", optarg); opt.sort = SORT_FILENAME; } + if (opt.randomize) { + weprintf("commandline contains --randomize and --sort. " + "--randomize has been unset"); + opt.randomize = 0; + } break; case 'T': theme = estrdup(optarg); @@ -642,6 +652,11 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) break; case 'z': opt.randomize = 1; + if (opt.sort != SORT_NONE) { + weprintf("commandline contains --sort and --randomize. " + "--sort has been unset"); + opt.sort = SORT_NONE; + } break; case '|': opt.start_list_at = estrdup(optarg); @@ -744,6 +759,13 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) case 238: opt.scroll_step = atoi(optarg); break; + case 239: + opt.xinerama_index = atoi(optarg); + break; + case 240: + opt.insecure_ssl = 1; + case 241: + opt.recursive = 0; default: break; } @@ -770,10 +792,21 @@ static void feh_parse_option_array(int argc, char **argv, int finalrun) static void check_options(void) { int i; + char *endptr; + for (i = 0; i < 10; i++) { if (opt.actions[i] && !opt.hold_actions[i] && (opt.actions[i][0] == ';')) { opt.hold_actions[i] = 1; - opt.actions[i] = &opt.actions[i][1]; + opt.actions[i] = opt.actions[i] + 1; + } + opt.action_titles[i] = opt.actions[i]; + if (opt.actions[i] && (opt.actions[i][0] == '[')) { + if (((endptr = strchr(opt.actions[i], ']')) != NULL) + && (opt.actions[i][1] != ' ')) { + opt.action_titles[i] = opt.actions[i] + 1; + opt.actions[i] = endptr + 1; + *endptr = 0; + } } } @@ -791,12 +824,6 @@ static void check_options(void) eprintf("You cannot combine --list with other modes"); } - if (opt.sort && opt.randomize) { - weprintf("You cant sort AND randomize the filelist...\n" - "randomize mode has been unset\n"); - opt.randomize = 0; - } - if (opt.loadables && opt.unloadables) { eprintf("You cannot combine --loadable with --unloadable"); } |