Commit Graph

12 Commits

Author SHA1 Message Date
mpeterv
247ed9e874 New Parser/Command property 'command_target'
Allows saving name of used command in a field of result target.
Helpful when command callbacks are stored in a table with names as keys
or when they are in submodules of some namespace.

Example:

    local parser = argparse():command_target("command")
    -- Add commands...
    local args = parser:parse()
    require("namespace." .. args.command).run(args)
2015-11-23 15:54:31 +03:00
mpeterv
01cc387863 Spec cleanups 2015-03-13 15:19:33 +03:00
mpeterv
59603d5f39 Fixed exploded tests to work with busted 2.0 2014-08-01 17:44:15 +04:00
mpeterv
7994dded7e Make command required by default 2014-02-23 16:27:23 +04:00
mpeterv
5b96416ada Minor change in an error message 2014-02-18 14:39:32 +04:00
mpeterv
ccad58ef50 return Parser as the module 2014-02-17 18:41:09 +04:00
mpeterv
404ec5213a Added help message generation; Improved optional arguments handling. 2014-01-26 15:21:11 +04:00
mpeterv
b1a011c3a8 added tips 2014-01-25 14:45:04 +04:00
mpeterv
c0039106f3 fixed tests: all printed data is quoted 2014-01-25 12:47:49 +04:00
mpeterv
c763e19b40 add even more sugar 2014-01-23 20:02:11 +04:00
mpeterv
bba513802b more command tests, added require_command 2014-01-19 15:27:25 +04:00
mpeterv
e81aab8a5b fixed arguments from root parser not formatted 2014-01-19 15:11:09 +04:00