summaryrefslogtreecommitdiff
path: root/cmd2/argparse_completer.py
Commit message (Collapse)AuthorAgeFilesLines
* Fixed issue where flag at beginning of REMAINDER section was tab completingKevin Van Brunt2018-10-101-10/+8
|
* Added code to handle -- in argparse completerKevin Van Brunt2018-10-101-19/+40
|
* Added tests for token_resembles_flagKevin Van Brunt2018-10-091-1/+2
|
* Added ability for argcompleter to determine difference between flag and ↵Kevin Van Brunt2018-10-091-9/+30
| | | | negative number
* Fixed unit test failures and addressed code review commentsTodd Leonhardt2018-10-061-16/+16
|
* Merge remote-tracking branch 'origin/master' into argparse_remainderEric Lin2018-10-061-0/+7
|\
| * Using sub-command instead of subcommand where possible to be consistent with ↵Kevin Van Brunt2018-10-051-0/+7
| | | | | | | | argparse
* | Fixed a few edge cases:Eric Lin2018-10-061-6/+17
| | | | | | | | | | | | | | | | | | - 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.
* | Added handling of nargs=argparse.REMAINDER in both AutoCompleter and ↵Eric Lin2018-10-061-31/+68
|/ | | | | | | | 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.
* Fixed usage statement where options were still appearing after the positionalsKevin Van Brunt2018-09-271-1/+1
|
* Updated documentationKevin Van Brunt2018-09-261-0/+3
|
* Fixing unit testsKevin Van Brunt2018-09-251-1/+1
|
* Merge branch 'master' into macroKevin Van Brunt2018-09-251-0/+12
|\
| * Added the the ability to format help to the AutoCompleter to support ↵Eric Lin2018-09-231-0/+12
| | | | | | | | sub-command specific help lookup.
* | Placed options at beginning of usage statement like argparse does.Kevin Van Brunt2018-09-241-10/+12
|/ | | | This is to prevent options appearing after the ... generated by argparse.REMAINDER.
* Fixed case where hints with no text printedKevin Van Brunt2018-09-211-4/+11
|
* Removed remaining type hints in docstringsKevin Van Brunt2018-09-211-6/+6
|
* ACHelpFormatter now inherits from argparse.RawTextHelpFormatter to make it ↵Kevin Van Brunt2018-08-241-4/+1
| | | | easier to format help/description text
* Updated argparse_completer to automatically set the matches_sorted flag for ↵Eric Lin2018-08-011-0/+1
| | | | tabular results. Updated the example to demonstrate pre-sorted tabular results.
* Added some explanation of CompletionItem usage in codeEric Lin2018-06-131-3/+30
|
* Added a check to verify the existence of a descriptive header. Added a ↵Eric Lin2018-06-131-1/+6
| | | | constant. Updated example to use the constant.
* Added .mypy_cache to .gitignoreTodd Leonhardt2018-06-101-22/+22
| | | | | Also: - Added a few more type hints
* Update to use new completion_header when returning completions in tabular ↵Eric Lin2018-06-071-5/+3
| | | | format with descriptions
* Adds possible support for tabular tab completion results.Eric Lin2018-06-061-0/+40
|
* Fixes problem with not passing the parameter hint suppression down to ↵Eric Lin2018-05-221-0/+13
| | | | | | | | sub-commands Added hint suppression on a per-parameter basis Added helper function to force an parameter to fall back to bash completion instead of using Cmd2 completion. - Hinting is still enabled by default but can be suppressed in the helper function.
* Changed some unit tests to use pytest-mock instead of mocker/monkeypatch ↵Eric Lin2018-05-191-1/+4
| | | | | | | because they were failing for me. Added detection of ==SUPPRESS== in subcommand group names to avoid printing it in the help hint. Added some examples to tab_autocompletion to demonstrate how to tie in to cmd2 path_complete
* Some fixes to autocompleter to make it easier to do delimited and file ↵Eric Lin2018-05-181-10/+40
| | | | completion. Saving state - more to come.
* Figured out how to detect the second tab press. Writing parameter hinting to ↵Eric Lin2018-05-031-1/+3
| | | | stderr to bypass bash completion handling.
* Further customization of argparse applying patch submitted to ↵Eric Lin2018-04-301-2/+262
| | | | | | | https://bugs.python.org/issue15112 Added additional tests - now at 100% coverage of pyscript_bridge.py Still need handling of special action types: StoreTrue/False, store_const, count
* Initial approach to the pyscript revamp.Eric Lin2018-04-241-1/+7
| | | | | Doesn't handle all argparse argument options yet (nargs, append, flag, probably more) For #368
* Updated constructor argumentsEric Lin2018-04-231-0/+2
|
* Added support for using cmd2 application class methods as an argument ↵Eric Lin2018-04-231-3/+15
| | | | completion provider. The default completion implementation in Cmd2 automatically passes self to AutoCompleter to be passed to the class method.
* Addressed PR comments. Simplified some of the implementation per PR comments.Eric Lin2018-04-231-1/+1
|
* Added some more comments for clarification.Eric Lin2018-04-211-3/+5
|
* Changed cmd2 to use autocompleter by default for all argparse commands. Not ↵Eric Lin2018-04-201-0/+22
| | | | all tests are passing yet.
* Identified and marked a few blocks of code that can't be reached during unit ↵Eric Lin2018-04-191-0/+9
| | | | tests due to the lack of a real terminal. Some more comments.
* Addresses comments on #362Eric Lin2018-04-191-0/+821