diff options
author | Eric Lin <anselor@gmail.com> | 2018-10-06 17:47:12 +0000 |
---|---|---|
committer | Eric Lin <anselor@gmail.com> | 2018-10-06 17:47:12 +0000 |
commit | b0d44379e3cecc2171ded506c58b74ee6e596670 (patch) | |
tree | 0a4c756ae14c8fe567712018c2e6f5bcea9164b1 /examples | |
parent | 96bcfe012b3b1659dbd0244ac6c4a43dfb5328d6 (diff) | |
download | cmd2-git-b0d44379e3cecc2171ded506c58b74ee6e596670.tar.gz |
Fixed a few edge cases:
- 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.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/tab_autocompletion.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/examples/tab_autocompletion.py b/examples/tab_autocompletion.py index 6be7f0c8..7725be95 100755 --- a/examples/tab_autocompletion.py +++ b/examples/tab_autocompletion.py @@ -298,6 +298,8 @@ class TabCompleteExample(cmd2.Cmd): .format(movie['title'], movie['rating'], movie_id, ', '.join(movie['director']), '\n '.join(movie['actor']))) + elif args.command == 'add': + print('Adding Movie\n----------------\nTitle: {}\nRating: {}\nDirectors: {}\nActors: {}\n\n'.format(args.title, args.rating, ', '.join(args.director), ', '.join(args.actor))) def _do_media_shows(self, args) -> None: if not args.command: |