summaryrefslogtreecommitdiff
path: root/cmd2/parsing.py
Commit message (Collapse)AuthorAgeFilesLines
* Updated main code to use f-stringsKevin Van Brunt2021-04-131-4/+4
|
* And that's the last of it. Passes mypy.Eric Lin2021-04-061-12/+8
|
* Replaced some pexcept() calls with perror().Kevin Van Brunt2021-04-021-1/+1
| | | | | | Converted some strings to f-strings. Fixed some grammar in error messages and docs. Increased code coverage.
* More things to make mypy happy.Eric Lin2021-04-021-20/+20
|
* Add in isort changesTodd Leonhardt2021-01-311-1/+3
|
* Add black for automatic code formatTodd Leonhardt2021-01-311-28/+31
|
* Changed isort to force wrapping of imports to reduce merge conflicts from ↵Eric Lin2021-01-221-3/+15
| | | | minor import changes.
* Replace with_argparser_and_unknown_args in docsKyle King2020-11-081-3/+2
|
* Added validation of subcommand handler attributesEric Lin2020-08-201-7/+12
|
* Added info on semantic versioning and branching strategy to CONTRIBUTING.mdTodd Leonhardt2020-04-241-2/+1
| | | | | | | 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
* Added Cmd2ShlexErrorKevin Van Brunt2020-03-121-5/+7
|
* Add documentation for parsing classeskotfu2020-02-141-108/+78
|
* Updated center_text to support ansi escape sequences and characters with ↵Kevin Van Brunt2019-12-091-4/+5
| | | | | | display widths greater than 1. Also added left and right justification functions.
* Removed ability for aliases and macros to share names with commandsKevin Van Brunt2019-08-051-15/+7
|
* Added terminators to completion delimitersKevin Van Brunt2019-08-021-2/+2
|
* Fixed inconsistent parsing/tab completion behavior based on the value of ↵Kevin Van Brunt2019-08-021-5/+1
| | | | | | `allow_redirection`. This flag is only meant to be a security setting that prevents redirection of stdout and should not alter parsing logic.
* Added terminators to cmd2.Cmd's docstringKevin Van Brunt2019-08-011-2/+2
|
* Removed restriction on macros named after non-multiline commandsKevin Van Brunt2019-07-231-4/+2
| | | | Added unit tests
* Updated docstringsKevin Van Brunt2019-07-231-5/+10
|
* Added to a few methods to prevent the command token from being expandedKevin Van Brunt2019-07-231-9/+8
|
* Moved the sorting of shortcuts into StatementParser which allows users to ↵Kevin Van Brunt2019-07-161-5/+8
| | | | pass in a dictionary instead of a tuple for shortcuts.
* Restore self.statement_parser to a public attribute in cmd2.CmdTodd Leonhardt2019-07-101-1/+1
|
* Removed unneeded (optional) text from docstringsKevin Van Brunt2019-06-261-5/+5
|
* Fixed a few comments where "redirecting" accidentally got changed to ↵Todd Leonhardt2019-06-151-1/+1
| | | | "_redirecting"
* Began work to minimize public APITodd Leonhardt2019-06-151-2/+2
|
* Preserving originally typed quotes of Statement.output_to for use in ↵Kevin Van Brunt2019-05-131-4/+5
| | | | Statement.post_command()
* Fixed parsing issue in case where output redirection (e.g. > file) appears ↵Kevin Van Brunt2019-05-131-36/+34
| | | | | | before a pipe. In that case, the pipe was given precedence even though it appeared later in the command.
* Added capability to redirect pipe commands and chain them togetherKevin Van Brunt2019-05-071-11/+11
|
* Merge branch 'master' into macro_refactorKevin Van Brunt2019-05-061-3/+1
|\
| * Fixed issue where the wrong terminator was being appended by ↵Kevin Van Brunt2019-05-061-3/+1
| | | | | | | | Statement.expanded_command_line()
* | Refactored alias resolution to get code coverage back to 100%Kevin Van Brunt2019-05-061-11/+13
| |
* | Macro resolution now occurs during parsingKevin Van Brunt2019-05-021-21/+25
|/
* No longer appending \n to commands run by PyscriptBridge. This messes up ↵Kevin Van Brunt2019-03-191-1/+1
| | | | | | redirection parsing of non-multiline commands.
* Merge branch 'master' into attributesTodd Leonhardt2019-03-171-39/+53
|\
| * Updated docs and exampleKevin Van Brunt2019-03-171-2/+2
| |
| * Updated documentationKevin Van Brunt2019-03-161-6/+8
| |
| * Added Statement object to argparse Namespace passed to wrapped functionsKevin Van Brunt2019-03-161-39/+51
| |
* | Aliases are now stored within the StatementParser instanceTodd Leonhardt2019-03-161-3/+3
| | | | | | | | | | | | | | Also: - Added read-only aliases property to cmd2.Cmd to get aliases from the StatementParser - Added a setter for the allow_redirection property in cmd2.Cmd - Made some initialization code more self-documenting
* | Improved type hints and documentation in StatementParser.__init__()Todd Leonhardt2019-03-141-9/+20
| |
* | Made several attributes of StatementParser immutableTodd Leonhardt2019-03-141-6/+6
|/ | | | | | | The following attributes within StatementParser were converted from mutable lists to immutable tuples: - terminators - multiline_commands - shortcuts
* Updated a comment and moved an importKevin Van Brunt2019-03-061-1/+1
|
* Moved some utility functions from cmd2.py to parsing.pyTodd Leonhardt2019-03-051-12/+40
|
* Added a shlex.split() wrapper to have a common way of calling it.Kevin Van Brunt2019-03-051-1/+11
| | | | Replaced parse_quoted_string with _get_command_arg_list.
* Merged master into history and resolved conflictsTodd Leonhardt2019-03-041-44/+10
|\
| * Removed support for c-style and embedded commentsKevin Van Brunt2019-03-011-44/+10
| |
* | Fixed a couple bugs and added unit testsTodd Leonhardt2019-03-031-1/+3
| |
* | Potential fixes for outstanding multi-line issues in history commandTodd Leonhardt2019-03-031-3/+3
| |
* | Merge branch 'master' into historyKevin Van Brunt2018-12-061-3/+3
|\ \ | |/
| * Fix flake8 issuesTodd Leonhardt2018-12-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | First version of adding an expanded option to history itemsKevin Van Brunt2018-12-031-0/+20
|/