argparse
argparse copied to clipboard
Command hierarchy should be reflected in the result table
If you define a hierarchy of command it should be organized the same way in the result table. It would avoid name collision between command names and argument names of subcommands.
local parser = argparse()
:name "test"
local mainCommand = parser:command "command"
local subcommand = mainCommand:command "subcommand"
subcommand:argument "arg"
lua cmd.lua command subcommand argument
{
mainCommand = {
subcommand = {
arg = "argument"
}
}
}