diff options
| author | Daniel Friesel <derf@finalrewind.org> | 2015-07-06 20:02:02 +0200 | 
|---|---|---|
| committer | Daniel Friesel <derf@finalrewind.org> | 2015-07-06 20:02:02 +0200 | 
| commit | d030c17f644cc726fca6d2216473cfc831185b0f (patch) | |
| tree | 73ff7cde1dc70e35afd72ec7927790aea889344c | |
| parent | b9c2f2c11d2d90ca9d6b3ea9d999ff835fc5706a (diff) | |
allow --sort and --randomize to override each other (issue #199)
| -rw-r--r-- | ChangeLog | 2 | ||||
| -rw-r--r-- | src/options.c | 16 | 
2 files changed, 12 insertions, 6 deletions
| @@ -4,6 +4,8 @@ git HEAD        (patch by James Knight)      * when removing the last image in slidsehow mode, stay on the last        (previously second-to-last) image (patch by Lior Shiponi) +    * Allow --sort and --randomize to override each other (most recently +      specified option wins) instead of always preferring --sort  Sun, 24 May 2015 11:45:18 +0200 diff --git a/src/options.c b/src/options.c index 120541a..804b485 100644 --- a/src/options.c +++ b/src/options.c @@ -530,6 +530,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); @@ -644,6 +649,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); @@ -796,12 +806,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");  	} | 
