-
Notifications
You must be signed in to change notification settings - Fork 124
Completion state #774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Completion state #774
Conversation
… can only have one level of subcommands No longer creating AutoCompleters for all subcommands each time tab is pressed
…ctions to receive a namespace of all arguments parsed up to token being completed. This will make it easier to have a previous argument's value affect what data is tab-completed.
…ompleter/choice functions that receive parsed_args will still know a flag was used.
…that have an argument called 'parsed_args'
Including the token being completed in arg_tokens
Codecov Report
@@ Coverage Diff @@
## master #774 +/- ##
==========================================
+ Coverage 97.31% 97.33% +0.02%
==========================================
Files 13 13
Lines 3459 3455 -4
==========================================
- Hits 3366 3363 -3
+ Misses 93 92 -1
Continue to review full report at Codecov.
|
tleonhardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
Including tokens from parent parsers in arg_tokens when subcommands are used
| * Enhancements | ||
| * No longer treating empty text scripts as an error condition | ||
| * Allow dynamically extending a `cmd2.Cmd` object instance with a `do_xxx` method at runtime | ||
| * Choices/Completer functions can now be passed a dictionary that maps command-line tokens to their |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the change to a dictionary instead of an argparse.Namespace
Choices/Completer functions can now be passed a dictionary that maps command-line tokens to their argparse argument. This is helpful when one argument determines what is tab completed for another argument. If these functions have an argument called
arg_tokens, then AutoCompleter will automatically pass this dictionary to them.Closes #762