mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +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:
@@ -31,19 +31,17 @@ Options:
|
||||
end)
|
||||
|
||||
it("uses description and epilog", function()
|
||||
local parser = Parser "foo"
|
||||
:description "A description. "
|
||||
:epilog "An epilog. "
|
||||
local parser = Parser("foo", "A description.", "An epilog.")
|
||||
|
||||
assert.equal([[
|
||||
Usage: foo [-h]
|
||||
|
||||
A description.
|
||||
A description.
|
||||
|
||||
Options:
|
||||
-h, --help Show this help message and exit.
|
||||
|
||||
An epilog. ]], parser:get_help())
|
||||
An epilog.]], parser:get_help())
|
||||
end)
|
||||
|
||||
it("creates correct help message for arguments", function()
|
||||
|
Reference in New Issue
Block a user