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

incus: Enable cobra's completion support #357

Merged
merged 1 commit into from
Jan 3, 2024
Merged

incus: Enable cobra's completion support #357

merged 1 commit into from
Jan 3, 2024

Conversation

stgraber
Copy link
Member

@stgraber stgraber commented Jan 3, 2024

No description provided.

Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
@@ -274,9 +274,14 @@ For help with any of those, simply call them with --help.`))
if globalCmd.flagHelpAll {
// Show all commands
for _, cmd := range app.Commands() {
if cmd.Name() == "completion" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't necessary. go run ./cmd/incus --help --all | grep completion with just the hidden flag does not show the completion command.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah but that's because of our custom help template, that code would have otherwise been needed so I went for just making the logic consistent with the manpage one.

That way should we ever change the help template to something more standard we won't find ourselves with the command showing up.

@brauner brauner merged commit 4e25b91 into lxc:main Jan 3, 2024
25 checks passed
@adamcstephens
Copy link
Contributor

Thanks for the quick change!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants