fset: use just "d" instead of "d:" to show changed options

This commit is contained in:
Sébastien Helleu 2017-05-31 20:01:19 +02:00
parent 7074f6e0d6
commit 805bc6ca2c
2 changed files with 8 additions and 7 deletions

View File

@ -287,7 +287,7 @@ fset_command_init ()
" * show all options (no filter)\n"
" f:xxx show only configuration file \"xxx\"\n"
" s:xxx show only section \"xxx\"\n"
" d: show only changed options\n"
" d show only changed options\n"
" d:xxx show only changed options with \"xxx\" in name\n"
" d=xxx show only changed options with \"xxx\" in value\n"
" d==xxx show only changed options with exact value \"xxx\"\n"

View File

@ -243,12 +243,13 @@ fset_option_match_filters (const char *config_name, const char *section_name,
/* filter by modified values */
if (!fset_option_value_different_from_default (fset_option))
return 0;
if (fset_option_filter[2]
&& !fset_option_string_match (fset_option->name, fset_option_filter + 2))
{
return 0;
}
return 1;
return fset_option_string_match (fset_option->name,
fset_option_filter + 2) ? 1 : 0;
}
else if (strcmp (fset_option_filter, "d") == 0)
{
/* filter by modified values */
return (fset_option_value_different_from_default (fset_option)) ? 1 : 0;
}
else if (strncmp (fset_option_filter, "==", 2) == 0)
{