mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 02:52:20 +00:00
Add hidden command and option aliases
Also auto-add an alias with dashes in place of underscores if an alias has an underscore.
This commit is contained in:
@@ -311,6 +311,24 @@ Commands:
|
||||
Usage: foo]], parser:get_help())
|
||||
end)
|
||||
|
||||
it("does not mention hidden option and command aliases", function()
|
||||
local parser = Parser "foo"
|
||||
parser:option "--server"
|
||||
:hidden_name "--from"
|
||||
parser:command "newname"
|
||||
:hidden_name "oldname"
|
||||
|
||||
assert.equal([[
|
||||
Usage: foo [-h] [--server <server>] <command> ...
|
||||
|
||||
Options:
|
||||
-h, --help Show this help message and exit.
|
||||
--server <server>
|
||||
|
||||
Commands:
|
||||
newname]], parser:get_help())
|
||||
end)
|
||||
|
||||
it("supports grouping options", function()
|
||||
local parser = Parser "foo"
|
||||
:add_help(false)
|
||||
|
Reference in New Issue
Block a user