Skip to content
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

Support __completeNoDesc hidden command #1922

Merged
merged 1 commit into from Nov 27, 2020

Conversation

marckhouzam
Copy link
Contributor

While investigating spf13/cobra#1279, I noticed that turning off descriptions does not currently work for goreleaser. And that this could impact bash completion if ValidArgsFunction is to eventually be used.

The __completeNoDesc command is used by bash to request completion without any descriptions. It is an alias for the __complete command. It must be properly supported for cobra.Command.ValidArgsFunction to work with bash completion.

You can test this change by turning off descriptions for Fish completion at this line by changing true to false:

err = cmd.Root().GenFishCompletion(cmd.OutOrStdout(), true)

Then without this PR, fish completion will be broken.

This test is representative because bash does not support descriptions, so instead of using __complete it uses __completeNoDesc.

The __completeNoDesc command is used by bash to request completion
without any descriptions.  It must be properly supported for
cobra.Command.ValidArgsFunction to work with bash completion.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
@vercel
Copy link

vercel bot commented Nov 27, 2020

@marckhouzam is attempting to deploy a commit to the Goreleaser Team on Vercel.

A member of the Team first needs to authorize it.

@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Nov 27, 2020
@marckhouzam
Copy link
Contributor Author

/cc @caarlos0

@codecov
Copy link

codecov bot commented Nov 27, 2020

Codecov Report

Merging #1922 (5f7a098) into master (c011943) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1922   +/-   ##
=======================================
  Coverage   81.69%   81.70%           
=======================================
  Files          73       73           
  Lines        3879     3880    +1     
=======================================
+ Hits         3169     3170    +1     
  Misses        582      582           
  Partials      128      128           
Impacted Files Coverage Δ
cmd/root.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c011943...5f7a098. Read the comment docs.

@caarlos0
Copy link
Member

Thanks 🙏

@caarlos0 caarlos0 merged commit e132922 into goreleaser:master Nov 27, 2020
@marckhouzam marckhouzam deleted the fix/completeNoDesc branch November 27, 2020 11:41
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants