Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
18207f6
Small refactor and documentation updates
kmvanbrunt Jul 1, 2019
b7fa4e4
Moved basic_complete to utils
kmvanbrunt Jul 2, 2019
479cab0
Removed cmd2.basic_complete function since it was added to utils
kmvanbrunt Jul 2, 2019
b10cc8f
Added functions to enable tab completion and choices provider functio…
kmvanbrunt Jul 2, 2019
5014fec
Patched argparse._ActionsContainer.add_argument() to support more set…
kmvanbrunt Jul 2, 2019
7ac7dd8
Merge branch 'master' into auto_completer_refactor
kmvanbrunt Jul 3, 2019
7a4dc0d
Updated comments
kmvanbrunt Jul 3, 2019
e6d3191
Fixed some bugs in _resolve_choices_for_arg
kmvanbrunt Jul 3, 2019
4360921
Merge branch 'master' into auto_completer_refactor
kmvanbrunt Jul 3, 2019
5208170
Moved cmd2 custom argparse types to argparse_custom.py
kmvanbrunt Jul 3, 2019
5b2ef86
Renamed ACHelpFormatter to Cmd2HelpFormatter
kmvanbrunt Jul 3, 2019
76d584f
Removed unused custom_error_message code
kmvanbrunt Jul 3, 2019
c9d5fc3
Fixed spelling
kmvanbrunt Jul 3, 2019
8f1bc02
No longer restricting nargs range support to Cmd2ArgParser
kmvanbrunt Jul 4, 2019
5b4ef18
Refactoring and updating documentation
kmvanbrunt Jul 4, 2019
bb8f6c4
Patched 2 more argparse functions to make nargs ranges work with all …
kmvanbrunt Jul 4, 2019
39127e6
Made optional args on completers keyword-only
kmvanbrunt Jul 4, 2019
4f2d1ba
Using argparse constants instead of hardcoded strings
kmvanbrunt Jul 4, 2019
c233b75
Fixing unit tests
kmvanbrunt Jul 4, 2019
60d731d
Fixing unit tests
kmvanbrunt Jul 4, 2019
93bd8c5
Merge branch 'master' into auto_completer_refactor
kmvanbrunt Jul 4, 2019
b3359eb
Fixing examples
kmvanbrunt Jul 4, 2019
7817c03
Fixing examples
kmvanbrunt Jul 4, 2019
aa41c31
Removed AutoCompleter parameters that are obsolete
kmvanbrunt Jul 5, 2019
891975e
Fixed some warnings
kmvanbrunt Jul 5, 2019
7024d7e
Added documentation
kmvanbrunt Jul 5, 2019
627d4bd
Fixed unit tests
kmvanbrunt Jul 5, 2019
1d56096
Simplifying unit tests for AutoCompleter
kmvanbrunt Jul 5, 2019
655243c
Reorganized argparse completion and custom unit tests
kmvanbrunt Jul 5, 2019
fa564a6
Refactoring and more unit tests
kmvanbrunt Jul 5, 2019
5ef4267
Made alias and macro tab completion lookup results use CompletionItems
kmvanbrunt Jul 6, 2019
67445d4
Display set command tab-completion results as CompletionItems
kmvanbrunt Jul 6, 2019
53f6c07
Added ability to limit how many CompletionItems display at a time
kmvanbrunt Jul 6, 2019
a63adb2
Merge branch 'master' into auto_completer_refactor
tleonhardt Jul 6, 2019
748a3e4
Updating unit tests
kmvanbrunt Jul 6, 2019
9eed45b
Merge branch 'auto_completer_refactor' of github.com:python-cmd2/cmd2…
kmvanbrunt Jul 6, 2019
f8f06bf
More unit tests
kmvanbrunt Jul 6, 2019
901aa9e
Fixed issue where default descriptive header wasn't set correctly
kmvanbrunt Jul 7, 2019
3470b88
Merge branch 'master' into auto_completer_refactor
kmvanbrunt Jul 7, 2019
90fb61f
Removed AutoCompleter that globally disables tab hints
kmvanbrunt Jul 7, 2019
47287f4
More unit tests
kmvanbrunt Jul 7, 2019
f8db8b7
Hiding flags that have help value of SUPRESSED in tab completion results
kmvanbrunt Jul 7, 2019
bb2dd69
Moved all custom argparse classes intended for normal development to …
kmvanbrunt Jul 8, 2019
8d3d598
More argparse completer unit tests
kmvanbrunt Jul 8, 2019
d9a4846
More unit tests
kmvanbrunt Jul 8, 2019
3140cd4
More unit tests
kmvanbrunt Jul 8, 2019
4a5b232
More unit tests
kmvanbrunt Jul 8, 2019
bdcc179
Fixed issue where -- was not handled properly in AutoCompleter when t…
kmvanbrunt Jul 8, 2019
36209ae
Added code to handle flags with action set to append, append_const, a…
kmvanbrunt Jul 8, 2019
9e49b7e
Resetting consumed arguments list each time a flag is used
kmvanbrunt Jul 8, 2019
3f70df6
Fixed issue where names of remainder flags were not completing
kmvanbrunt Jul 10, 2019
b188531
Added some tests for REMAINDER flags
kmvanbrunt Jul 10, 2019
1c2dc43
Small refactoring to simplify code
kmvanbrunt Jul 10, 2019
bb58b2f
Merge branch 'master' into auto_completer_refactor
kmvanbrunt Jul 10, 2019
2ebf636
Fixed bug where -- wasn't stopping a REMAINDER flag and did a lot of …
kmvanbrunt Jul 10, 2019
60e294e
Removed unused variable
kmvanbrunt Jul 10, 2019
782bab8
Fixed some double-dash handling logic added unit tests
kmvanbrunt Jul 10, 2019
734fee8
Small refactors and doc updates
kmvanbrunt Jul 10, 2019
2ef1f27
Added unit tests
kmvanbrunt Jul 10, 2019
50e143c
Added unit tests for argparse_custom.py
kmvanbrunt Jul 10, 2019
bc80c99
Small refactoring
kmvanbrunt Jul 10, 2019
ca89266
More unit tests
kmvanbrunt Jul 10, 2019
6cf0237
Merge branch 'master' into auto_completer_refactor
kmvanbrunt Jul 11, 2019
eb5b4ff
Added documentation
kmvanbrunt Jul 11, 2019
c1312ca
Updated documentation
kmvanbrunt Jul 11, 2019
9ca1ecf
Updated CHANGELOG
kmvanbrunt Jul 11, 2019
bd1eb85
Updated CHANGELOG
kmvanbrunt Jul 11, 2019
a28896f
Removed unused code and add unit test
kmvanbrunt Jul 11, 2019
2a1f548
Changes suggested in code review
kmvanbrunt Jul 11, 2019
5546bd8
Changed how re is being imported
kmvanbrunt Jul 12, 2019
73fad36
Refactored much of AutoCompleter.complete_command.
kmvanbrunt Jul 12, 2019
d857eac
More refactoring
kmvanbrunt Jul 12, 2019
4149be4
Added comments
kmvanbrunt Jul 12, 2019
6a9e3d9
Fixed issue where flags did not always complete while in a positional
kmvanbrunt Jul 12, 2019
938bb97
Removed unused code
kmvanbrunt Jul 12, 2019
98dd8cf
Updated docs
kmvanbrunt Jul 12, 2019
9bb6b84
Renamed Cmd2ArgParser to ArgParser
kmvanbrunt Jul 12, 2019
ddf4c2c
Changed unfinished flag error format
kmvanbrunt Jul 12, 2019
fdbd9d5
Fixed flake8 warning
kmvanbrunt Jul 12, 2019
6e826f2
Fixed issue where flag arg hints weren't always printing
kmvanbrunt Jul 12, 2019
dc747c6
Added unit tests for unfinished flag errors
kmvanbrunt Jul 12, 2019
191b4c2
More unit tests
kmvanbrunt Jul 12, 2019
96e16c9
More unit tests
kmvanbrunt Jul 12, 2019
5d1fcdb
Simplified unit tests
kmvanbrunt Jul 12, 2019
0b9794a
Added more hint unit tests
kmvanbrunt Jul 12, 2019
d6d50a0
Removed link to deleted example
kmvanbrunt Jul 15, 2019
87702b5
Made a few module functions protected
kmvanbrunt Jul 15, 2019
bff6e04
Make max_completion_items settable
kmvanbrunt Jul 15, 2019
2e541a8
Updated documentation
kmvanbrunt Jul 15, 2019
218091f
Added ability to specify nargs ranges with no upper bound
kmvanbrunt Jul 15, 2019
22a1d42
Added unit tests
kmvanbrunt Jul 15, 2019
719641c
More unit tests
kmvanbrunt Jul 15, 2019
aa394cd
Changed format of help where nargs is a number greater than 1
kmvanbrunt Jul 15, 2019
dda4fba
Updated CODEOWNERS
kmvanbrunt Jul 15, 2019
def2f6a
Added link to argparse_custom.py to change log
kmvanbrunt Jul 16, 2019
3ad59ce
Fixed link text
kmvanbrunt Jul 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
## 0.9.15 (July TBD, 2019)
* Enhancements
* Greatly simplified using argparse-based tab completion. The new interface is a complete overhaul that breaks
the previous way of specifying completion and choices functions. See header of [argparse_custom.py](https://github.com/python-cmd2/cmd2/blob/master/cmd2/argparse_custom.py)
for more information.
* **Renamed Commands Notice**
* The following commands were renamed in the last release and have been removed in this release
* `load` - replaced by `run_script`
Expand All @@ -9,7 +13,11 @@
* Breaking Changes
* Restored `cmd2.Cmd.statement_parser` to be a public attribute (no underscore)
* Since it can be useful for creating [post-parsing hooks](https://cmd2.readthedocs.io/en/latest/features/hooks.html#postparsing-hooks)

* Completely overhauled the interface for adding tab completion to argparse arguments. See enhancements for more details.
* `ACArgumentParser` is now called `ArgParser`
* Moved `basic_complete` to utils.py
* Made optional arguments on the following completer methods keyword-only:
`delimiter_complete`, `flag_based_complete`, `index_based_complete`. `path_complete`, `shell_cmd_complete`

## 0.9.14 (June 29, 2019)
* Enhancements
Expand Down
34 changes: 17 additions & 17 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@

# cmd2 code
cmd2/__init__.py @tleonhardt @kotfu
cmd2/argparse_completer.py @anselor @kmvanbrunt
cmd2/ansi.py @kmvanbrunt @tleonhardt
cmd2/argparse_*.py @kmvanbrunt
cmd2/clipboard.py @tleonhardt
cmd2/cmd2.py @tleonhardt @kmvanbrunt @kotfu
cmd2/constants.py @kotfu
cmd2/parsing.py @kotfu @kmvanbrunt
cmd2/pyscript_bridge.py @anselor @kmvanbrunt
cmd2/plugin.py @kotfu
cmd2/pyscript_bridge.py @kmvanbrunt
cmd2/rl_utils.py @kmvanbrunt
cmd2/transcript.py @kotfu
cmd2/utils.py @tleonhardt @kotfu @kmvanbrunt
Expand All @@ -29,23 +31,21 @@ cmd2/utils.py @tleonhardt @kotfu @kmvanbrunt
docs/* @tleonhardt @kotfu

# Examples
examples/env*.py @kotfu
examples/help*.py @anselor
examples/tab_au*.py @anselor
examples/tab_co*.py @kmvanbrunt
examples/async_printing.py @kmvanbrunt
examples/environment.py @kotfu
examples/tab_*.py @kmvanbrunt

# Unit Tests
tests/pyscript/* @anselor @kmvanbrunt
tests/transcripts/* @kotfu
tests/__init__.py @kotfu
tests/conftest.py @kotfu @tleonhardt
tests/test_acar*.py @anselor
tests/test_argp*.py @kotfu
tests/test_auto*.py @anselor
tests/test_comp*.py @kmvanbrunt
tests/test_pars*.py @kotfu
tests/test_pysc*.py @anselor
tests/test_tran*.py @kotfu
tests/pyscript/* @kmvanbrunt
tests/transcripts/* @kotfu
tests/__init__.py @kotfu
tests/conftest.py @kotfu @tleonhardt
tests/test_argparse.py @kotfu
tests/test_argparse_*.py @kmvanbrunt
tests/test_comp*.py @kmvanbrunt
tests/test_pars*.py @kotfu
tests/test_run_pyscript.py @kmvanbrunt
tests/test_transcript.py @kotfu

# Top-level project stuff
CONTRIBUTING.md @tleonhardt @kotfu
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ Instructions for implementing each feature follow.

See https://cmd2.readthedocs.io/en/latest/argument_processing.html for more details

NOTE: `cmd2` also provides the `ACArgumentParser` customization of `argparse.ArgumentParser` for prettier formatting
of help and RangeAction type
NOTE: `cmd2` also provides the `cmd2.ArgParser` customization of `argparse.ArgumentParser` for prettier formatting
of help and error messages.

- `cmd2` applications function like a full-featured shell in many ways (and are cross-platform)
- Run arbitrary shell commands by preceding them with `!` or `shell`
Expand Down Expand Up @@ -182,8 +182,7 @@ Instructions for implementing each feature follow.
- `delimiter_complete` helper method for tab completion against a list but each match is split on a delimiter
- See the [tab_autocompletion.py](https://github.com/python-cmd2/cmd2/blob/master/examples/tab_autocompletion.py) example for a demonstration of how to use this feature
- `cmd2` in combination with `argparse` also provide several advanced capabilities for automatic tab-completion
- See the [tab_autocompletion.py](https://github.com/python-cmd2/cmd2/blob/master/examples/tab_autocompletion.py) and
[tab_autocomp_dynamic.py](https://github.com/python-cmd2/cmd2/blob/master/examples/tab_autocomp_dynamic.py) examples for more info
- See the [tab_autocompletion.py](https://github.com/python-cmd2/cmd2/blob/master/examples/tab_autocompletion.py) example for more info

- Multi-line commands

Expand Down
1 change: 1 addition & 0 deletions cmd2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
pass

from .ansi import style
from .argparse_custom import ArgParser, CompletionItem
from .cmd2 import Cmd, Statement, EmptyStatement, categorize
from .cmd2 import with_argument_list, with_argparser, with_argparser_and_unknown_args, with_category
from .constants import DEFAULT_SHORTCUTS
Expand Down
Loading