14 Commits

Author SHA1 Message Date
Paul Ouellette
24398b67ce Add tests for help command 2019-05-25 00:24:49 -04:00
Paul Ouellette
55acc1689c Fix tests broken due to change in help flag order 2019-05-24 22:48:27 -04:00
Peter Melnichenko
8baabbbe23 Split labels for multi-alias options into lines in help string 2018-04-08 15:03:56 +03:00
Peter Melnichenko
3a43d528c6 Fix whitespace warnings 2018-03-16 17:26:31 +03:00
mpeterv
babe715548 Change error messages for missing elements
* For arguments: "argument 'foo' is required" -> "missing argument 'foo'"
* For options: "option '--foo' must be used at least 1 time" ->
  "missing option '--foo'"
2015-10-30 15:13:30 +03:00
mpeterv
247c8a9cce Redesign argument storing
* Use state objects instead of tons of locals in the main
  function.
* Use actions for storing arguments into result table.
  Actions are now called at the end of each invocation,
  with result table, target index, arguments and overwrite flag as
  arguments.
* Remove command actions.
* Improve error messages, refer to options by the last used alias
  instead of the main name.

TODO:

* Improve error messages further ("argument 'foo' is required"
  -> "missing argument 'foo'", etc.).
* Add actions for positional arguments.
* Add actions for commands (should be called with final results
  after parsing is over, in "innermost first" order).
* Allow referring to built-in actions by strings a-la Python
  (e.g. action = "store_false").
* Allow setting initial value to be stored at target index
  for each option (perhaps use default value for that).
* Add more tests, particularly for actions.
2015-10-29 21:00:49 +03:00
mpeterv
7134d25ca5 Add coverage gathering 2015-09-24 18:55:10 +03:00
mpeterv
476ad19de8 Avoid printing space at the end of line 2015-03-13 15:40:24 +03:00
mpeterv
0da90dc597 Print \n instead of \r\n 2015-03-13 15:12:06 +03:00
mpeterv
bd5fd00e6c Custom target should not affect usage and help message generation 2014-08-25 13:51:08 +04:00
mpeterv
59603d5f39 Fixed exploded tests to work with busted 2.0 2014-08-01 17:44:15 +04:00
mpeterv
c605f248ad Better name inference 2014-03-08 16:25:54 +04:00
mpeterv
ccad58ef50 return Parser as the module 2014-02-17 18:41:09 +04:00
mpeterv
2a49500a01 added cli test 2014-01-26 19:02:36 +04:00