| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| | |
year
|
| |
| |
| |
| |
| |
| | |
application to quit
Implemented an antediluvian TODO
|
|/
|
|
|
|
|
|
|
|
|
| |
Issues were two fold:
- HistoryItem statement.raw was getting mangled for multiline commands due to macro-related changes in _input_line_to_statement()
- HistoryItem pretty printing wasn't using rstrip() anymore in verbose mode
I added a couple unit tests in the process of getting here. But we should add some explicit unit tests of _input_line_to_statement() for cases like:
- basic single-line command
- macro single-line command
- multiline command
|
|
|
|
| |
now binary
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
to instance attributes
The following are now instance attributes:
- allow_cli_args
- default_to_shell
- quit_on_sigint
The following class attribute was deleted due to lack of use:
- reserved_words
The following instance attribute was deleted due to lack of use:
- keywords
|
|\ \
| |/ |
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Deleted bash tab completion support.
AutoCompleter no longer assumes CompletionItem results are sorted.
|
|
|
|
| |
calling init()
|
| |
|
|
|
|
| |
whole console
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__Fore__ and __Back__ are used on line 128 but they are never defined or imported. That means that they are _undefined names_ which have the potential to raise NameError at runtime.
[flake8](http://flake8.pycqa.org) testing of https://github.com/python-cmd2/cmd2 on Python 3.7.1
$ __flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics__
```
./examples/plumbum_colors.py:127:21: F821 undefined name 'Fore'
color_off = Fore.RESET + Back.RESET
^
./examples/plumbum_colors.py:127:34: F821 undefined name 'Back'
color_off = Fore.RESET + Back.RESET
^
```
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
command foo if it uses an argparse decorator
Also:
- Renamed argparse_example.py to decorator_example.py
|
|
|
|
|
|
|
| |
to be unique
Also:
- Modified table_display.py to demonstrate a workaround
|
| |
|
|\ |
|
| |
| |
| |
| | |
argparse
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Once the argument list can match a positional and that positional is tagged
with nargs=argparse.REMAINDER it will consume all tokens including flag tokens.
AutoCompleter now correctly detects this case will no longer attempt to complete
flag tokens
- A single-character token that is a flag prefix doesn't count as a flag and is
parsed as a value. AutoCompleter now correctly detects this case.
|
|/
|
|
|
|
|
|
| |
ArgparseFunctor
Should correctly force all subsequent arguments to go to the REMAINDER argument once it is detected.
Re-arranged the command generation in ArgparseFunctor to print flag arguments before positionals
Also forces the remainder arguments to always be last.
|
| |
|
|
|
|
| |
functions
|
| |
|
| |
|
|\ |
|
| |\ |
|