| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
to prevent breaking change
Also:
- Reverted multilineCommands and shortcuts to class variables to prevent other breaking changes
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that users can nest instances of cmd.Cmd2 to support creating sub-menus, we should need to be more careful about class vs instance variables to prevent potential problems.
This converts the following former class variables into instance variables:
- multiline_commands
- shortcuts
- exclude_from_help
- exclude_from_history
In the process, a couple camelCase variable names got converted to pep8_compliant names.
There may be a few other class variables which should be converted to instance variables. But at the very least, this is a good start.
This closes #273.
|
| |
|
|
| |
NixOS build and packaging system builds with a fake $HOME which has no contents. This assertion will fail in those cases, and doesn’t really test the completion code anyway.
|
| |
|
|
|
|
| |
- The Windows pexpect API is different from macOS or Linux
- On Travis CI, the test behaves as if readline isn't working on those machines
- The test runs fine when run on my system (on either macOS or Linux)
|
| |
|
|
| |
different there
|
| |
|
|
| |
example
|
| | |
|
| |
|
|
|
|
| |
Added pexpect to modules required for running unit tests.
This opens the door for carefully crafted complex unit tests to verify intricate behavior. Tests like this are somewhat painful to write and slow to execute. However, they can enable testing complicated interactive behavior that we otherwise probably would not be able to test.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Including an example and info in the Sphinx docs
Also:
- Created CHANGELOG entry for 0.8.1 release
- Added info to README about new sub-menu feature
- Bumped version to 0.8.1
TODO:
- Added a unit test for the persistent readline history feature
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
| |
History changes:
- Unknown commands are no longer saved in the history
- history command now has a -t option to generate a transcript based on commands in the history
Also:
- Moved examples transcripts from examples to examples/transcripts
- Added a new transcript for use with the pirate.py example
|
| |
|
|
| |
Also added a section on Sub-commands to the documentation.
|
| | |
|
| |
|
|
| |
Also bumped version to 0.8.0.
|
| |
|
|
| |
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.
|
| |
|
|
| |
Removed usage of and reference to attributes and commands which have now been removed.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
a -a/--all option to the set command
|
| | |
|
| |
|
|
|
|
| |
It's functionality has been moved inside the set command.
The set command now uses an argparse parser.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
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
|
| |
|
|
| |
argparse output for invalid option has different text and goes to stderr
|
| |
|
|
| |
This one depends on the help text for history
|
| | |
|
| | |
|