-
Notifications
You must be signed in to change notification settings - Fork 929
(#669) Improve PowerShell Tab Completion #3725
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
Conversation
NOTE: This issue relies on this issue being completed, in order to list out only the local packages that are not pinned. Until that is completed, the associated Pester tests will fail to complete. |
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.
Had a quick look over it, and just one question came to mind.
@AdmiringWorm I have made the suggested change, and I have also kicked off a Test-Kitchen build as well. Once you are happy, I think that this one is ready to be merged. |
@AdmiringWorm I have had to make a slight change here, as there were some failing tests. I am going to run the Test-Kitchen tests again. I am expecting that there will be one failure, until the |
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.
Forgot to submit the review, here is what I noticed.
@AdmiringWorm I have updated this PR by rebasing onto the head of the develop branch (fixing some merge conflicts) and I have added a new commit to add the usage of the |
This commit improves the PowerShell Tab Completion for Chocolatey CLI, by including completions for the following commands: * apikey * config * feature * pin * rule * source * template Each of these completions rely on directly calling the equivalent "list£ sub-command for each command (with the exception of one of the pin completions, which also relies on running choco list), which unfortunately can take a second to complete. As a future enhancement to this functionality, we should look to serializing these completions to disk, so that they can be loaded and shown from there. These files would be updated each time an associated command is executed. For example, when someone runs "choco source add" update the completions file for when doing "choco source remove". A group of Pester tests have been added to ensure that these completions work as expected.
To ensure that the tab completion always works, regardless of whether the alwaysIncludeHeaders feature is enabled or not, explicitly make use of the --include-headers option on each execution of Chocolatey CLI. This allows us to control what happens with the output, and knowingly understand the headers that are output. In addition, expand some options to use their default option values, for example: -r -> --limit-output -h -> --help
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.
LGTM, had to make a small change to switch away for brackets to parenthesis.
@gep13 great work on getting these tab completions added 👍 |
Description Of Changes
This commit improves the PowerShell Tab Completion for Chocolatey CLI, by including completions for the following commands:
Each of these completions rely on directly calling the equivalent "list£ sub-command for each command (with the exception of one of the pin completions, which also relies on running choco list), which unfortunately can take a second to complete.
As a future enhancement to this functionality, we should look to serializing these completions to disk, so that they can be loaded and shown from there. These files would be updated each time an associated command is executed. For example, when someone runs "choco source add" update the completions file for when doing "choco source remove".
A group of Pester tests have been added to ensure that these completions work as expected.
Motivation and Context
We want to have as good an experience at the command line as possible. By bringing more things into the completions file, we make it easier to do the work that is being done.
Testing
The new Pester tests exercise all the tab completions. If the Test-Kitchen tests complete, we shoud be good.
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Relates to #669
Some additional work is required in order to complete this issue.