mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-30 03:52:19 +00:00
Reorder properties
Move more common properties to the front of property lists, so that they can be passed as constructor arguments. E.g. parser:option "-p" "--port" :description "Port number." :default "8080" :convert(tonumber) can now be expressed as parser:option("-p --port", "Port number.", "8080", tonumber)
This commit is contained in:
@@ -218,13 +218,13 @@ local Argument = new_class({
|
||||
}, {
|
||||
typechecked("name", "string"),
|
||||
typechecked("description", "string"),
|
||||
typechecked("target", "string"),
|
||||
boundaries("args"),
|
||||
typechecked("default", "string"),
|
||||
typechecked("convert", "function", "table"),
|
||||
boundaries("args"),
|
||||
typechecked("target", "string"),
|
||||
typechecked("defmode", "string"),
|
||||
typechecked("show_default", "boolean"),
|
||||
typechecked("argname", "string", "table"),
|
||||
typechecked("convert", "function", "table")
|
||||
typechecked("argname", "string", "table")
|
||||
})
|
||||
|
||||
local Option = new_class({
|
||||
@@ -234,15 +234,15 @@ local Option = new_class({
|
||||
}, {
|
||||
multiname,
|
||||
typechecked("description", "string"),
|
||||
typechecked("target", "string"),
|
||||
typechecked("default", "string"),
|
||||
typechecked("convert", "function", "table"),
|
||||
boundaries("args"),
|
||||
boundaries("count"),
|
||||
typechecked("default", "string"),
|
||||
typechecked("target", "string"),
|
||||
typechecked("defmode", "string"),
|
||||
typechecked("show_default", "boolean"),
|
||||
typechecked("overwrite", "boolean"),
|
||||
typechecked("argname", "string", "table"),
|
||||
typechecked("convert", "function", "table"),
|
||||
typechecked("action", "function")
|
||||
}, Argument)
|
||||
|
||||
|
Reference in New Issue
Block a user