| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
command foo if it uses an argparse decorator
Also:
- Renamed argparse_example.py to decorator_example.py
|
| |
|
|
|
|
|
| |
to be unique
Also:
- Modified table_display.py to demonstrate a workaround
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
These classes are subtly different, particularly in terms of their truthiness.
CmdResult
- attributes: out, err, war
- truthy: if err is falsy
CommandResult
- attributes: stdout, stderr, data
- truthy: if err is falsy AND data is not None
So CmdResult was oriented to provide essentially info, error, and warning messages to the user (typically as stirngs), whereas CommandResult is geared towards providing info and error messages to the user as strings in addition to data to the user in a command-specific format which is arbitrary other than it should never be None if the command succeeds.
|
| | |
|
| |\
| |
| |
| |
| | |
# Conflicts:
# cmd2.py
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
Changed the detection of with_argparse decorated commands to be less hacky/brittle.
Now it tags the function with help_summary.
Fixed issue with handling commands that provide a custom help_ function. We can now
redirect the output to a string to be formatted with the other commands.
Added some documentation explaining the new help categories.
Updated unit tests.
|
| |/
|
|
|
| |
Also:
- Bumped version to 0.8.4
|
| | |
|
| |
|
|
|
|
|
|
| |
Improved the documentation related to how to use the argparse decorators.
Also:
- Fixed a comment in cmd2.py which referred to the old decorator before the rename
- Fixed README.md which had the old decorator name in it prior to the rename
|
| |
|
|
|
| |
Also:
- Reanamed foo and bar subcommand methods to base_foo and base_bar
|
| |
|
|
| |
Also added a section on Sub-commands to the documentation.
|
| |
|
|
|
|
| |
I eliminated a few "narg=1" configurations so that a single str value is returned instead of a List[str].
I also reworded some documentation which was no longer correct after the last commit which made "history command" have the same help text as "command -h" when using one of the two argparse decorators.
|
| |
|
|
| |
@options optparse-based decorator
|
| |
|
|
| |
Also added another @with_argparser_and_list decorator that uses argparse.parse_known_args to pass two arguments to a command: both the argparse output and a list of unknown/unmatched args.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|