| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
function provided.
In verbose help, added check for argparse usage block (starting with 'usage: '), to skip that block and move to the next comment block
Added unit tests for new categorization code
Updated example to demonstrate skipping of argparse usage statement
|
| |
|
|
|
| |
Reads the __doc__ for a command function and provides the first block of text for each command.
Updated help_categories.py to demonstrate a multi-line comment block for a command.
|
| | |
|
| |
|
|
| |
Added example of multiple commands grouped by categories
|
| | |
|
| | |
|
| | |
|
| | |
|
| |\ |
|
| | | |
|
| |/
|
|
|
| |
Renamed excludeFromHistory to exclude_from_history
No longer tab completing hidden commands
|
| |
|
|
| |
terminal before attempting to use a pager
|
| |
|
|
|
|
|
|
|
|
| |
Added a default signal handler for SIGINT that does the following:
- Terminates a pipe process if one exists
- Raises a KeyboardInterrupt for other parts othe code to catch
Also:
- Changed the default value for quit_on_sigint to False
- Modified the way the subcommand functions are called in subcommand.py (unrelated to rest of commit)
|
| |\ |
|
| | | |
|
| |/ |
|
| |
|
|
|
|
| |
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
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
Added example showing how to display tabular data in a cmd2 application.
Also:
- Updated CHANGELOG with data on all PRs since last release
- Bumped version to 0.8.2 in preparation for next release
|
| | |
|
| |
|
|
|
|
| |
Also:
- Added paged_output.py example
- Modified cmd2 so it keeps track of when output is being redirected so it doesn't attempt to usage a pager in this case
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
| |
- Since path_complete got moved outside of cmd2.Cmd and is now a function instead of a method, need to do partial argument binding with functools.partial() instead of functools.partialmethod()
|
| |
|
|
|
|
|
|
|
| |
The remove_unused.py example had become outdated since the cmdenvironment command no longer exists.
The help text for the edit command was outdated since the functionality for editing previous commands got moved from the edit command to the history command.
This closes #276.
This closes #282.
|
| |
|
|
| |
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
|
| |
|
|
| |
This is simply to allow introspection on self for debug and development
|
| |
|
|
| |
Added shebang line
|
| |\ |
|
| | |
| |
| |
| |
| | |
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
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Modified the do_help() method to behave differently for methods which have been decorated with an argparse ArgumentParser.
This is so that help will properly deal with sub-command help.
Suppose you have a base command "base" which has two sub-commands, "foo" and "bar". Then "help base" will provide very different help text than "help base foo".
Slightly tweaked the two argparse decorators to set an attribute in the decorated function's dictionary so that the do_help method can know which functions have an ArgumentParser and which do not.
Added a "subcommands.py" example for demonstrating how to create and use subcommands based on argparse and the cmd2 @with_argument_parser decorator.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
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
|