-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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.
- Loading branch information
Showing
7 changed files
with
407 additions
and
369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.