-
Notifications
You must be signed in to change notification settings - Fork 124
Tab completion #291
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
Tab completion #291
Conversation
Moved path_complete out of the Cmd class Rewrote shell_complete
- Since path_complete got moved outside of cmd2.Cmd and is now a function instead of a method, need to do partial argument binding with functools.partial() instead of functools.partialmethod()
…symbols now tab complete.
Codecov Report
@@ Coverage Diff @@
## master #291 +/- ##
==========================================
- Coverage 91.57% 91.45% -0.12%
==========================================
Files 1 1
Lines 1424 1486 +62
==========================================
+ Hits 1304 1359 +55
- Misses 120 127 +7
Continue to review full report at Codecov.
|
|
@kmvanbrunt Before we merge this, I would like to see the following added:
|
| return app | ||
|
|
||
|
|
||
| def test_cmd2_subcommand_completion_single_end(sc_app): |
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.
These unit tests for subcommand completion should not be deleted. They should simply be refactored to use index_based_complete() or complete() instead of the old complete_subcommand().
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. Thanks for including good unit tests and an example.
This adds flag-based and index-based tab-completion helper functions.
This closes #288.
Tab completion for subcommand help was also added.
This closes #274