| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
# Conflicts:
# cmd2/__init__.py
# cmd2/argparse_completer.py
# cmd2/argparse_custom.py
# cmd2/cmd2.py
# cmd2/decorators.py
# cmd2/exceptions.py
# cmd2/utils.py
# examples/arg_decorators.py
# examples/argparse_completion.py
# examples/modular_commands_main.py
# tests/test_argparse_completer.py
# tests/test_argparse_custom.py
# tests/test_cmd2.py
# tests/test_completion.py
# tests/test_history.py
|
| | |
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
minor import changes.
|
|
|
|
|
|
| |
display help when called with -h/--help.
'add_help=False' no longer has to be passed to parsers used in @as_subcommand_to decorator.
|
|
|
|
|
|
|
| |
are now
Cmd2AttributeWrapper objects named cmd2_statement and cmd2_handler. This makes it
easy to filter out which attributes in an argparse.Namespace were added by cmd2.
|
|
|
|
|
|
| |
attribute cmd2 was adding
Added get_statement() function to argparse.Namespace which returns __statement__ attribute
|
| |
|
|
|
|
| |
implementation as an option to with_argparser instead.
|
|
|
|
|
|
|
| |
Also:
- Added isort to Pipenv dev
- Added setup.cfg to make it easy to run flake8, doc8, and isort directly from the command line without using invoke
- Ran isort to sort includes
|
|
|
|
|
|
| |
correct prog value
This makes dynamically adding subcommands after the CLI starts easier.
|
|
|
|
| |
instead of the actual name
|
| |
|
|
|
|
| |
this is no longer needed
|
| |
|
| |
|
| |
|
|
|
|
| |
Replaced parse_quoted_string with _get_command_arg_list.
|
|\ |
|
| | |
|
|/ |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
argparse
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
Now there is a single class, StdSim in utils.py, which is intended to simulate stdout and stderr file objects.
This class replaced the following:
- pyscript_bridge.py::CopyStream
- transcript.py::OutputTrap
- conftest.py::StdOut
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
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
|
|/ |
|
| |
|
| |
|
|
|
|
| |
This reverts commit 4a3d01b679c5db7f6cb670ca981a953eb3b98dc5.
|
|
|
|
| |
Still have a fair amount of work to do to get this sorted.
|
|
|
|
|
| |
mock was a backport of Python's built in unittest.mock and was required for Python 3.2 or earlier
- Since we now support Python 3.4+ moving forward we no longer need to make use of the 3rd party mock module
|
| |
|
| |
|
|
|
|
| |
As similar try/except needed to be added to a couple unit test files to try to import gnureadline as readline and fallback to importing readline.
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
for argparse commands
In order to make "help" behave more consistently for decorated and undecorated commands, argparse output is temporarily redirected to self.stdout. So doing "help history" is similar to "help load".
However, when using the "-h" with argparse commands without using the "help" command, the output from argparse isn't redirected to self.stdout. Fixing this would be rather difficult and would essentially involve creating a pyparsing rule to detect it at the parser level.
|
|
|
|
|
| |
Also:
- Reanamed foo and bar subcommand methods to base_foo and base_bar
|
| |
|
|
|
|
| |
Updated unit tests due to changes in how help is output for commands decorated with an argparse ArgumentParser.
|
|
|
|
|
|
| |
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.
|