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

Add shell completion command by bumping cobra to 1.8.1 #339

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hougesen
Copy link

@hougesen hougesen commented Oct 20, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Problem/Feature

This PR updates the version of github.com/spf13/cobra to the latest (1.8.1), since it has support for automatic shell completion generation.

Merging this will close #336.

Description of Changes:

  • Updated github.com/spf13/cobra to v1.8.1
  • Documented usage of completion command

Checklist

  • My code follows the Contribution Guide
  • I have self-reviewed the changes being requested
  • I have made comments on pieces of code that may be difficult to understand for other editors
  • I have updated the documentation (if applicable)

@Xemdo
Copy link
Contributor

Xemdo commented Nov 9, 2024

Since we can detect what system/shell you're on anyway, should we consider doing this automatically using Cobra's completion generation functions instead?

@hougesen
Copy link
Author

Are you talking about removing the need for specifying the shell when running twitch completion, or automatically generating shell completions on install?

If the former, I would personally expect all users that wish to have shell completion to already know which shell they use, reducing the need for simplifying the command.

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

Successfully merging this pull request may close these issues.

Cobra subcommand completion?
2 participants