uutils: implement shell completions#2414
Merged
sylvestre merged 8 commits intouutils:masterfrom Jun 26, 2021
Merged
Conversation
tertsdiepraam
approved these changes
Jun 17, 2021
Collaborator
tertsdiepraam
left a comment
There was a problem hiding this comment.
Amazing! Nice solution for hashsum too! I just wondered whether usage and after_help should be in uu_app too. I also have some minor suggestions for some utils, which we can make issues for if you don't want to fix them here,
Collaborator
|
Sorry, I introduced some conflicts this by first merging #2361, could you take a look at those? After that, we should merge this quickly, because it looks good and it will keep conflicting with other PR's. |
Contributor
|
Impressive work. It would be great to have a section in the README to document the user feature :) |
0c67de2 to
ba336b5
Compare
Contributor
Author
|
I'll fix the merge conflicts myself, if you don't mind :) |
Contributor
|
@miDeb oh, yes, please, I made a mistake :( |
This adds a hidden `completion` subcommand to coreutils. When invoked with `coreutils completion <utility> <shell>` a completion file will be printed to stdout. When running `make install` those files will be created for all utilities and copied to the appropriate locations. `make install` will install completions for zsh, fish and bash; however, clap also supports generating completions for powershell and elvish. With this patch all utilities are required to have a publich uu_app function that returns a clap::App in addition to the uumain function.
Contributor
|
No big deal but maybe handle the error a bit better: |
Contributor
|
or |
11 tasks
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.
This adds a hidden
completionsubcommand to coreutils. When invoked withcoreutils completion <utility> <shell>a completion file will be printedto stdout. When running
make installthose files will be created for allutilities and copied to the appropriate locations.
make installwill install completions for zsh, fish and bash; however,clap also supports generating completions for powershell and elvish.
With this patch all utilities are required to have a publich uu_app function
that returns a clap::App in addition to the uumain function.