Support -no-levenshtein-sort

This commit is contained in:
QC 2015-04-19 13:19:20 +02:00
parent 6456512695
commit 9bb51a9b35
3 changed files with 13 additions and 2 deletions

View File

@ -419,10 +419,12 @@ The following options are further explained in the theming section:
### History and Sorting ### History and Sorting
`-disable-history` `-disable-history`
`-no-disable-history` (re-enable history)
Disable history Disable history
`-levenshtein-sort` `-levenshtein-sort` to enable
`-no-levenshtein-sort` to disable
When searching sort the result based on levenshtein distance. When searching sort the result based on levenshtein distance.

View File

@ -526,10 +526,12 @@ To get one merge view, of window,run,ssh:
.SS History and Sorting .SS History and Sorting
.PP .PP
\fB\fC\-disable\-history\fR \fB\fC\-disable\-history\fR
\fB\fC\-no\-disable\-history\fR (re\-enable history)
.IP .IP
Disable history Disable history
.PP .PP
\fB\fC\-levenshtein\-sort\fR \fB\fC\-levenshtein\-sort\fR to enable
\fB\fC\-no\-levenshtein\-sort\fR to disable
.IP .IP
When searching sort the result based on levenshtein distance. When searching sort the result based on levenshtein distance.
.SS Dmenu specific .SS Dmenu specific

View File

@ -237,6 +237,13 @@ static void config_parse_cmd_option ( XrmOption *option )
if ( find_arg ( key ) >= 0 ) { if ( find_arg ( key ) >= 0 ) {
*( option->value.num ) = TRUE; *( option->value.num ) = TRUE;
} }
else {
g_free ( key );
key = g_strdup_printf ( "-no-%s", option->name );
if ( find_arg ( key ) >= 0 ) {
*( option->value.num ) = FALSE;
}
}
break; break;
case xrm_Char: case xrm_Char:
find_arg_char ( key, option->value.charc ); find_arg_char ( key, option->value.charc );