Merged
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✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ 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 ☔ View full report in Codecov by Sentry. |
tleonhardt
previously approved these changes
Sep 15, 2019
Including tokens from parent parsers in arg_tokens when subcommands are used
tleonhardt
approved these changes
Sep 16, 2019
| * 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 |
Member
There was a problem hiding this comment.
I like the change to a dictionary instead of an argparse.Namespace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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