summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorEric Lin <anselor@gmail.com>2018-10-06 17:47:12 +0000
committerEric Lin <anselor@gmail.com>2018-10-06 17:47:12 +0000
commitb0d44379e3cecc2171ded506c58b74ee6e596670 (patch)
tree0a4c756ae14c8fe567712018c2e6f5bcea9164b1 /examples
parent96bcfe012b3b1659dbd0244ac6c4a43dfb5328d6 (diff)
downloadcmd2-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-xexamples/tab_autocompletion.py2
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: