summaryrefslogtreecommitdiff
path: root/examples/pirate.py
Commit message (Collapse)AuthorAgeFilesLines
* Updated one example so it can be used properly with default_to_shellTodd Leonhardt2018-03-161-4/+0
|
* Renamed @with_argument_parser decorator to @with_argparserTodd Leonhardt2018-01-211-2/+2
| | | | | Also: - Reanamed foo and bar subcommand methods to base_foo and base_bar
* History enhancementsTodd Leonhardt2018-01-201-8/+8
| | | | | | | | | | 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
* Simplified a few argparse examples and fixed some incorrect documentationTodd Leonhardt2018-01-171-2/+2
| | | | | | 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.
* Changed @with_argument_parser to only pass single argument to commandsTodd Leonhardt2018-01-151-11/+12
| | | | 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.
* Modified examples still using @options to import make_option from optparseTodd Leonhardt2018-01-151-1/+2
|
* Fixed a few bugs and examplesTodd Leonhardt2017-07-031-7/+9
| | | | | | | | | | | | | | 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
* Mostly fix a bunch of spelling mistakes.Todd Leonhardt2017-03-131-1/+1
| | | | A few other miscellaneous minor tweaks for whitespace and such.
* Improved examplesTodd Leonhardt2017-03-111-0/+89
Added the pirate8.py example from Catherine's PyCon2010 talk as pirate.py with some cleanups done. Added an example of a complete_* method for command argument completion to the python_scripting.py example.