| 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
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Updated unit tests due to changes in how help is output for commands decorated with an argparse ArgumentParser.
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|
|
|
| |
This is so that non-essential info which isn't directly associated with command output, such as time elapsed while executing a command, won't redirect when command output is redirected using >, >>, or |.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Bug fixes:
- case_insensitive is no longer a runtime-settable parameter, but it was still listed as such
- Fixed a recursive loop bug when abbreviated commands are enabled and it could get stuck in the editor forever
- Added additional command abbreviations to the "exclude from history" list
- Fixed argparse_example.py and pirate.py examples
Other changes:
- Organized all attributes used to configure the ParserManager into a single location
- Set the default value of "abbrev" to False (which controls whether or not abbreviated commands are allowed)
- With good tab-completion of command names, using abbreviated commands isn't a particularly useful feature
- And it can create problems
|
|
|
|
|
|
| |
It was pretty useless, it just printed a message and sat there and waited for the user to hit enter.
It didn't feel like it belonged in a top-level framework. If a particular application wants this functionality, it is a 2 line change to add it back.
|
|
|
|
|
|
|
|
| |
Load and relative load now require a file path
Edit will use a temporary file by default and delete it when done
Save will use a temporary file by default and inform the user what it is
Also changed the default value for autorun_on_edit to False so that it can safely be used as an actual file editor.
|
|
|
|
|
|
|
|
| |
This command is explicitly for running Python script files within an embedded Python interpreter.
The advantages over the py command with "run" are:
- Tab-completion of file system paths is supported
- Command-line arguments can be passed to the Python script
|
|
|
|
|
|
|
|
| |
The extra functionality of listing a span (slice) of history items present in the list command has been incorporated into the existing history command and the list command has been removed.
Unit tests have been updated accordingly.
In the process a bug was fixed that was causing a crash if and end was supplied to the span but not a start.
|
|
|
|
|
|
|
|
| |
Added a list of commands to explicitly exclude displaying in the help menu of commands which detailed help can be retrieved for.
By default, only "do_eof" is in this list since that isn't a command which is ever intended for an end user to directly enter on the command line.
Also updated unit tests to reflect new default help menu.
|
|
|
|
|
|
| |
Transcript testing no longer creates an unnecessary 2nd instance of the class derived from cmd2.Cmd. This dramatically simplifies transcript testing for derived classes which have required parameters during construction.
As a side effect the, feedback_to_output attribute now defaults to false. This had some minor ripple effects on various unit tests.
|
|
|
|
| |
A few other miscellaneous minor tweaks for whitespace and such.
|
|
|
|
|
|
|
|
| |
Also:
- Added locals_in_py to settable parameters to match documentation.
- Added pycon2010 slides back into doc build since they are referenced with :doc:
- Fixed some references in the documentation
- Updated unit tests accordingly
|
|
|
|
|
|
|
|
| |
1) Built-in commands which use @options now properly deal with the USE_ARG_LIST boolean flag
2) Added an "autorun_on_edit" settable parameter which defaults to True to preserve backwards compatibility, but can be set False to prevent automatically running files as scripts when the editor closes
3) Improved how piping works so it can deal with commands which output a large amount of data
|
|
|
|
|
|
|
|
| |
The out-of-the-box help menu now looks a lot cleaner:
- All redundant command aliases have been removed
(NOTE: They can still be used if self.abbrev is True, which is the default)
- All previously undocumented commands have been documented
- Unit tests and README.rst documentation has been updated to reflect new behavior
|
| |
|
| |
|
| |
|
|
|
|
| |
compatibility via use of the six module.
|
|
|