summaryrefslogtreecommitdiff
path: root/examples/arg_print.py
Commit message (Collapse)AuthorAgeFilesLines
* Add black for automatic code formatTodd Leonhardt2021-01-311-0/+1
|
* Marked with_arparser_and_unknown_args deprecated and consolidatedEric Lin2020-08-041-1/+1
| | | | implementation as an option to with_argparser instead.
* Fixed a bunch of examples which were broken due to moving DEFAULT_SHORTCUTS ↵Todd Leonhardt2019-06-161-1/+1
| | | | from cmd2.py to constants.py
* Refactor exit_code implementationTodd Leonhardt2019-05-201-1/+2
| | | | | | | | | | | | cmd2.Cmd.cmdloop() now returns self.exit_code which should be an integer Also: - Refactored examples to call sys.exit(app.cmdloop()) in their __main__ - Running transcript tests now sets the exit_code accordingly based on success/failure - Updated CHANGELOG - Updated README - Updated Sphinx docs - Added unit test for case when transcript test fails
* Fixed how shortcuts are set in examplesTodd Leonhardt2019-03-141-6/+3
|
* First stage of attribute refactoringTodd Leonhardt2019-03-131-1/+1
| | | | | | | | | | The following are now arguments to cmd2.Cmd.__init__() instead of class attributes: * allow_redirection * multiline_commands * terminators * shortcuts Added a couple read-only properties for convenience of cmd2.Cmd accessing immutable members from self.statement_parser
* Fix for when with_argument_list is called with preserve_quotes optional argumentTodd Leonhardt2019-03-041-0/+5
|
* Fix flake8 issuesTodd Leonhardt2018-12-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | This commit contains a very large number of trivial changes in order to fix flake8 errors and warnings. Predominantly these are whitespace changes. Additionally, the build for Python 3.7 on TravisCI has been tweaked to fail if there are any flake8 errors using the following commandline: * flake8 . --count --ignore=E252 --max-complexity=31 --max-line-length=127 --show-source --statistics NOTE: In the future the max cyclomatic complexity should be lowered, but some improvements need to be made first. One flake8 error is being ignored entirely: * E252 missing whitespace around parameter equals * ignored because it doesn't correctly deal with default argument values after a type hint A few flake8 errors are being selectively ignored in certain files: * C901 fuction is too complex * ignored in argparse_completer.py because the complex code is an override of argparse complexity * E302 expected 2 blank lines after ... * ignored in all unit test files for convenience * F401 module imported but unused * ignored in cmd2/__init__.py because imports are for convenience of cmd2 developers and backwards compatibility * F821 undefined name * ignored in cmd2 script files which are intended to run only within cmd2 applications via pyscript where "app" and "cmd" are defined
* Addressing code review commentsKevin Van Brunt2018-09-281-1/+1
|
* Updated a couple files in the examples directory due to changes in alias commandTodd Leonhardt2018-09-271-4/+3
|
* Fix import stragglerskotfu2018-05-231-5/+9
|
* Standardize cmd2 imports in tests and exampleskotfu2018-05-231-7/+4
|
* Merge branch 'test_merge' into test_ply_mergeEric Lin2018-05-021-4/+2
|\
| * Removed the expensive imports from cmd2/__init__.pyEric Lin2018-04-251-4/+2
| | | | | | | | | | | | | | Added some shared definitions to cmd2/__init__.py -> maybe there's a better place for these? Figured out how to trick bash into showing argument hints. It's a bit weird. Updated all of the tests and examples to import cmd2 resources from their new location without the automatic imports in cmd2/__init__.py For #369
* | Clean up documentation references to pyparsingkotfu2018-04-291-4/+1
| |
* | multilineCommands -> multiline_commandskotfu2018-04-291-1/+1
|/
* Started removing dependency on sixTodd Leonhardt2018-04-151-1/+1
| | | | | | | Removed all dependency on six other than for six.moves.input Also: - Started removing code branches which were for Python 2 support
* Use self.poutput() instead of print() in arg_print.py exampleTodd Leonhardt2018-03-071-4/+4
|
* 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
* Renamed new decorator to @with_argparser_and_unknown_args to make it more ↵Todd Leonhardt2018-01-151-2/+2
| | | | descriptive
* Changed @with_argument_parser to only pass single argument to commandsTodd Leonhardt2018-01-151-9/+30
| | | | 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
|
* Updated docs to make it more clear that you need to update shortcuts ↵Todd Leonhardt2017-11-091-1/+8
| | | | attribute before calling super class __init__
* Improved documentation for how a user can modify comment grammar/styleTodd Leonhardt2017-09-221-0/+39
Also: - Added arg_print.py example to demonstrate this - Bumped version to 0.7.8a - Updated CHANGELOG