1
0
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:
Sébastien Helleu
2019-08-24 07:13:34 +02:00
parent 04162214d4
commit 61c5d08320
22 changed files with 463 additions and 371 deletions
+4
View File
@@ -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 "
+16
View File
@@ -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 */