mirror of
https://github.com/weechat/weechat.git
synced 2026-07-08 18:53:12 +02:00
fset: add filters "h=xxx" and "he=xxx" to filter options by description (translated or in English)
This commit is contained in:
@@ -646,6 +646,10 @@ fset_command_init ()
|
||||
"value\n"
|
||||
" d==xxx show only changed options with exact value "
|
||||
"\"xxx\"\n"
|
||||
" h=xxx show only options with \"xxx\" in "
|
||||
"description (translated)\n"
|
||||
" he=xxx show only options with \"xxx\" in "
|
||||
"description (in English)\n"
|
||||
" =xxx show only options with \"xxx\" in value\n"
|
||||
" ==xxx show only options with exact value \"xxx\"\n"
|
||||
" c:xxx show only options matching the evaluated "
|
||||
|
||||
@@ -372,6 +372,22 @@ fset_option_match_filter (struct t_fset_option *fset_option, const char *filter)
|
||||
/* filter by modified values */
|
||||
return (fset_option_value_is_changed (fset_option)) ? 1 : 0;
|
||||
}
|
||||
else if (strncmp (filter, "h=", 2) == 0)
|
||||
{
|
||||
/* filter by help text (translated) */
|
||||
return (fset_option_string_match (
|
||||
(fset_option->description && fset_option->description[0]) ?
|
||||
_(fset_option->description) : "",
|
||||
filter + 2)) ? 1 : 0;
|
||||
}
|
||||
else if (strncmp (filter, "he=", 3) == 0)
|
||||
{
|
||||
/* filter by help text (in English) */
|
||||
return (fset_option_string_match (
|
||||
(fset_option->description && fset_option->description[0]) ?
|
||||
fset_option->description : "",
|
||||
filter + 3)) ? 1 : 0;
|
||||
}
|
||||
else if (strncmp (filter, "==", 2) == 0)
|
||||
{
|
||||
/* filter by exact value */
|
||||
|
||||
Reference in New Issue
Block a user