]> source.dussan.org Git - rspamd.git/commitdiff
Adopt confighelp for required and default attrs
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jan 2016 18:50:19 +0000 (18:50 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jan 2016 18:50:19 +0000 (18:50 +0000)
src/rspamadm/confighelp.lua

index 476065b2fb2e401d150c13ada156d4a53257dce9..3af3c5b1fad3693cd5ff166b995e73bd0591f61c 100644 (file)
@@ -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)