From b0d44379e3cecc2171ded506c58b74ee6e596670 Mon Sep 17 00:00:00 2001 From: Eric Lin Date: Sat, 6 Oct 2018 17:47:12 +0000 Subject: 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. --- examples/tab_autocompletion.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'examples') 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: -- cgit v1.2.1