summaryrefslogtreecommitdiff
path: root/cmd2.py
Commit message (Collapse)AuthorAgeFilesLines
* cmdenvironment command has been removed and its functionality now exists as ↵Todd Leonhardt2018-01-151-16/+25
| | | | a -a/--all option to the set command
* show command has been removedTodd Leonhardt2018-01-151-13/+17
| | | | | | It's functionality has been moved inside the set command. The set command now uses an argparse parser.
* __relative_load command is now hidden from help menu by defaultTodd Leonhardt2018-01-151-1/+1
|
* Argument parsing and support currention functionality for #252kotfu2018-01-151-12/+16
| | | | still need to add support for -o, -r, and -e options.
* Renamed new decorator to @with_argparser_and_unknown_args to make it more ↵Todd Leonhardt2018-01-151-1/+1
| | | | descriptive
* Changed @with_argument_parser to only pass single argument to commandsTodd Leonhardt2018-01-151-20/+46
| | | | 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.
* Just improved a few comments which had become outdatedTodd Leonhardt2018-01-151-5/+6
|
* Replaced @options decorator with @with_argument_list for do_editTodd Leonhardt2018-01-151-7/+11
|
* Made a couple cleanup changesTodd Leonhardt2018-01-151-12/+11
| | | | | | | | | 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
* Merge branch 'arglist' of github.com:python-cmd2/cmd2 into arglistkotfu2018-01-141-1/+5
|\
| * Fixed do_history unit tests and implementationTodd Leonhardt2018-01-151-1/+1
| |
| * Fixed @with_argument_decorator so that built-in help text is preservedTodd Leonhardt2018-01-151-0/+4
| |
* | convert do_pyscript() to use @with_argument_listkotfu2018-01-141-9/+5
| |
* | convert do_show() to argparsekotfu2018-01-141-12/+9
|/
* convert do_history() to argparsekotfu2018-01-141-20/+16
|
* remove use_argument_list attributekotfu2018-01-141-6/+2
|
* refactor onecmd() to use parse_quoted_string()kotfu2018-01-141-7/+1
|
* Convert built-in commands to argparsing for #250kotfu2018-01-141-13/+17
| | | | | | | | | | | | | This commit converts the following methods: - do_eos() - do_eof() - do_quit() - do_shortcuts() - do_cmdenvironment() - do__relative_load() - do_load() - do_help()
* more robust argparse and arglist decoratorskotfu2018-01-141-16/+18
|
* add use_argument_list settingkotfu2018-01-121-1/+13
| | | | 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.
* new @with_argument_list decoratorkotfu2018-01-121-0/+18
|
* @with_argument_parser now passes an arglist instead of a stringkotfu2018-01-121-1/+1
|
* Fix a nasty bug in @with_argument_parserJared Crapo2018-01-101-3/+3
| | | | second argument of do_* methods was getting mangled when we strip quotes
* Set prog in argparser based on the name of the functionkotfu2018-01-071-1/+5
|
* Properly set docstring so it contains help messagekotfu2018-01-071-1/+9
|
* Remove leftover debugging codekotfu2018-01-071-2/+0
|
* Merge branch 'master' of github.com:python-cmd2/cmd2 into argparsekotfu2018-01-071-5/+5
|\
| * Enabled Python 3.7 testing on Travis CITodd Leonhardt2018-01-061-5/+5
| | | | | | | | Also bumped version to 0.8.0a
* | Default posix and quote removal working.kotfu2018-01-071-12/+10
| |
* | Merge branch 'master' of github.com:python-cmd2/cmd2 into argparsekotfu2018-01-071-12/+28
|\ \ | |/
| * Fix test_transcript.py in python 3.7kotfu2018-01-061-1/+16
| | | | | | | | re.escape() changed behavior in python 3.7.
| * Updating version and changelog in preparation for minor bug fix realeaseTodd Leonhardt2018-01-041-11/+12
| |
* | New test cases for argparseJared Crapo2018-01-071-2/+14
| |
* | Merge branch 'master' of https://github.com/python-cmd2/cmd2 into argparseJared Crapo2017-12-111-4/+15
|\ \ | |/
| * Bump version to 0.7.9aTodd Leonhardt2017-11-151-1/+1
| | | | | | | | To distinguish it from the previous or next release
| * Added fix for changes in pyperclip project structure in the most recent versionTodd Leonhardt2017-11-081-4/+15
| | | | | | | | | | | | | | | | | | Also included a number of minor maintenance updates: - Bumped version to 0.7.8 in preparation for upcoming release - Updated Readme.md to add link to slides from recent Florida PyCon talk about cmd2 - Updated documentation on integrating cmd2 with other event loops to use newer runcmds_plus_hooks() method instead of legacy onecmds_plus_hooks method which doesn't properly deal with load commands - Deleted old files which were used to prepare for a PyCon 2010 presentation - Updated ChangeLog regarding this bug fix
* | Plan and first working code for argparse decoratorJared Crapo2017-12-111-0/+15
|/
* Removed a conditional which was made redundant by an outer conditional that ↵Todd Leonhardt2017-09-231-4/+0
| | | | got added
* Fixed a bug when edit is passed a large negative integer in quotesTodd Leonhardt2017-09-231-3/+21
| | | | | | Fixed a weird corner case. Also added some comments to do_edit to better explain what the code is doing.
* Fixed a bug which occurred when edit was called with an integer index larger ↵Todd Leonhardt2017-09-231-7/+11
| | | | | | | | | than the length of the history Previously a edit was creating a file named 'None' in this case. Now an error is printed to the screen and no editor is opened. Also did some miscellaneous cleanup based on PyCharm warnings.
* Merge branch 'master' into support-load-in-onecmd_plus_hooksTodd Leonhardt2017-09-221-1/+1
|\
| * Improved documentation for how a user can modify comment grammar/styleTodd Leonhardt2017-09-221-1/+1
| | | | | | | | | | | | | | Also: - Added arg_print.py example to demonstrate this - Bumped version to 0.7.8a - Updated CHANGELOG
* | Provide method to run multiple commands w/o a cmdloop.Alfred Levy2017-09-221-12/+45
|/ | | | | | | | | | | | runcmds_plus_hooks can accept multiple commands process the command queue to deal with subsequent commands loaded from scripts without requiring a command loop. This better supports a one-off batch processing scenario. Also fixed the insertion order of commands placed in the command queue by load and _relative_load so that script commands are run in the expected order. Minor tweak to setup instructions in CONTRIBUTING.md to include pyperclip in prerequisites.
* Improved poutput() so that it can print an integer zero and other falsy thingsTodd Leonhardt2017-09-051-1/+1
| | | | | | | The poutput() function has been ruggedized so that it has a better conditional check so that it will actually print things which are "falsy" but are still convertible to a string. A few unit tests have been added specifically for the poutput function.
* Minor bug fixTodd Leonhardt2017-08-231-3/+2
|
* Exit on <control>D when on a ttyJared Crapo2017-08-231-0/+2
|
* Prompt and line now properly echoed on tty and pipeJared Crapo2017-08-231-9/+29
| | | | if we are on a pipe, we have to echo the prompt only after we read and are not at EOF.
* Don’t try and sane the tty if stdin isn’t a ttyJared Crapo2017-08-231-2/+3
|
* Improved what gets printed when running commands from a script with load ↵Todd Leonhardt2017-08-231-4/+3
| | | | | | command and echo is True Previously just the command get printed. Now the prompt and the command gets printed.
* Updated CHANGELOG with some text regarding recent enhancements to transcript ↵Todd Leonhardt2017-08-221-5/+5
| | | | | | regexes Also bumped version from 0.7.7a to 0.7.7 in preparation for eventual next release.