From: Vsevolod Stakhov Date: Mon, 4 Jan 2016 18:50:19 +0000 (+0000) Subject: Adopt confighelp for required and default attrs X-Git-Tag: 1.1.0~127 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57a464ab523700fc7f2ab3f116724cd198799da8;p=thirdparty%2Frspamd.git Adopt confighelp for required and default attrs --- diff --git a/src/rspamadm/confighelp.lua b/src/rspamadm/confighelp.lua index 476065b2fb..3af3c5b1fa 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)