]> git.e2factory.org Git - e2factory.git/commitdiff
Format option and flag dicts
authorTobias Ulmer <tu@emlix.com>
Mon, 2 Dec 2013 18:49:27 +0000 (19:49 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/e2option.lua

index 1f1a7868b77dafae2c024342cf82a5d3135594fb..bbd48b3b5b5c0f4b3671d293b570a193da3daf0d 100644 (file)
@@ -55,9 +55,14 @@ function e2option.flag(name, doc, func, category)
     if options[name] then
         return false, err.new("option exists: %s", name)
     end
-    options[name] = {type = "flag", documentation = doc or "", name = name,
-    proc=func, default = true,
-    category = category}
+    options[name] = {
+        type = "flag",
+        documentation = doc or "",
+        name = name,
+        proc=func,
+        default = true,
+        category = category
+    }
     table.insert(optionlist, name)
 end
 
@@ -72,9 +77,13 @@ function e2option.option(name, doc, default, func, argname)
     if options[name] then
         return false, err.new("option exists: %s", name)
     end
-    options[name] = {type = "option", documentation = doc or "", name = name,
-    proc=func, default=default or true,
-    argumentname=argname or "ARGUMENT"}
+    options[name] = {
+        type = "option",
+        documentation = doc or "", name = name,
+        proc=func,
+        default=default or true,
+        argumentname=argname or "ARGUMENT"
+    }
     table.insert(optionlist, name)
 end