diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-03-07 10:13:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-07 10:13:03 +0000 |
commit | 152f1af776e055b48c0b23754bb1ced6d803b97d (patch) | |
tree | 493d81e28d21e6afd8d6a0db3152cd6219665569 /src | |
parent | aee73a3340bd9dc6dfc3a8412ebb8193df9ba016 (diff) | |
parent | c7f1d9a0e74954f0462f1cdfe456e90132c7ac54 (diff) | |
download | rspamd-152f1af776e055b48c0b23754bb1ced6d803b97d.tar.gz rspamd-152f1af776e055b48c0b23754bb1ced6d803b97d.zip |
Merge pull request #1490 from fatalbanana/partial
[Fix] Fix partial matches in rspamadm grep
Diffstat (limited to 'src')
-rw-r--r-- | src/rspamadm/grep.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/rspamadm/grep.c b/src/rspamadm/grep.c index 7fa3b953d..b88347a8b 100644 --- a/src/rspamadm/grep.c +++ b/src/rspamadm/grep.c @@ -47,7 +47,7 @@ static GOptionEntry entries[] = { "Enable case-sensitivity in string search", NULL}, {"orphans", 'o', 0, G_OPTION_ARG_NONE, &orphans, "Print orphaned logs", NULL}, - {"partial", 'P', 0, G_OPTION_ARG_NONE, &orphans, + {"partial", 'P', 0, G_OPTION_ARG_NONE, &partial, "Print partial logs", NULL}, {NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL, NULL} }; @@ -93,7 +93,7 @@ rspamadm_grep (gint argc, gchar **argv) "\n Release id: " RID); g_option_context_add_main_entries (context, entries, NULL); - g_option_context_set_ignore_unknown_options (context, TRUE); + g_option_context_set_ignore_unknown_options (context, FALSE); if (!g_option_context_parse (context, &argc, &argv, &error)) { rspamd_fprintf (stderr, "option parsing failed: %s\n", error->message); @@ -131,18 +131,12 @@ rspamadm_grep (gint argc, gchar **argv) } } ucl_object_insert_key (obj, nobj, "inputs", 0, false); - if (sensitive) { - ucl_object_insert_key (obj, ucl_object_frombool (sensitive), - "sensitive", 0, false); - } - if (orphans) { - ucl_object_insert_key (obj, ucl_object_frombool (orphans), - "orphans", 0, false); - } - if (partial) { - ucl_object_insert_key (obj, ucl_object_frombool (partial), - "partial", 0, false); - } + ucl_object_insert_key (obj, ucl_object_frombool (sensitive), + "sensitive", 0, false); + ucl_object_insert_key (obj, ucl_object_frombool (orphans), + "orphans", 0, false); + ucl_object_insert_key (obj, ucl_object_frombool (partial), + "partial", 0, false); rspamadm_execute_lua_ucl_subr (L, argc, |