| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
| |
As similar try/except needed to be added to a couple unit test files to try to import gnureadline as readline and fallback to importing readline.
|
| |
|
|
|
|
| |
functools.partialmethod() was added in Python 3.4, so it can't be used in Python 2.7.
- Modified the code to skip trying to use it for Python 2.7
- Skip the two unit tests which test its usage on Python 2.7
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
for argparse commands
In order to make "help" behave more consistently for decorated and undecorated commands, argparse output is temporarily redirected to self.stdout. So doing "help history" is similar to "help load".
However, when using the "-h" with argparse commands without using the "help" command, the output from argparse isn't redirected to self.stdout. Fixing this would be rather difficult and would essentially involve creating a pyparsing rule to detect it at the parser level.
|
| |
|
|
|
| |
Also:
- Reanamed foo and bar subcommand methods to base_foo and base_bar
|
| | |
|
| |
|
|
| |
Updated unit tests due to changes in how help is output for commands decorated with an argparse ArgumentParser.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
Now "help command_name" and "command_name -h" provide exactly the same text.
The function docstring for the "do_*" command sets and overrides the ArgumentParser "description" if the docstring is not empty.
|
| | |
|
| |
|
|
| |
descriptive
|
| |
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
1) cmd2 no longer imports make_option from optparse
- test files and examples now import this directly
- this helps emphasize that this old optparse methodology of adding options to commands is deprecated
2) All argparsers have been given custom names instead of just "argparser"
- this helps with readability and maintainability, especially with IDE renaming and such
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
new attribute on Cmd2.cmd which defaults to false, but if set true, causes all do_* commands to receive a list of arguments, instead of a string of what the user typed.
|
| | |
|
| | |
|
| |
|
|
| |
second argument of do_* methods was getting mangled when we strip quotes
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|