argparse icon indicating copy to clipboard operation
argparse copied to clipboard

Command hierarchy should be reflected in the result table

Open giann opened this issue 8 years ago • 0 comments

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"
        }
    }
}

giann avatar Oct 18 '17 12:10 giann