diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-04 18:50:19 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-01-04 18:50:19 +0000 |
commit | 57a464ab523700fc7f2ab3f116724cd198799da8 (patch) | |
tree | 369ffccf53d6c216fc65e5896cebd50bd05685e6 /src/rspamadm | |
parent | 8d5360b2f8dbff3a314f686c71c5973911726f06 (diff) | |
download | rspamd-57a464ab523700fc7f2ab3f116724cd198799da8.tar.gz rspamd-57a464ab523700fc7f2ab3f116724cd198799da8.zip |
Adopt confighelp for required and default attrs
Diffstat (limited to 'src/rspamadm')
-rw-r--r-- | src/rspamadm/confighelp.lua | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/rspamadm/confighelp.lua b/src/rspamadm/confighelp.lua index 476065b2f..3af3c5b1f 100644 --- a/src/rspamadm/confighelp.lua +++ b/src/rspamadm/confighelp.lua @@ -3,7 +3,9 @@ local opts = {} local known_attrs = { data = 1, example = 1, - type = 1 + type = 1, + required = 1, + default = 1, } --.USE "getopt" @@ -74,6 +76,18 @@ local function print_help(key, value, tabs) print('') end end + if type(value['required']) == 'boolean' then + if value['required'] then + print(string.format('%s\tRequired: %s', tabs, + maybe_print_color(tostring(value['required'])))) + else + print(string.format('%s\tRequired: %s', tabs, + tostring(value['required']))) + end + end + if value['default'] then + print(string.format('%s\tDefault: %s', tabs, value['default'])) + end end local sorted = sort_values(value) |