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

Feature Request: Bash/Zsh Tab Completion #1114

Closed
cedricmckinnie opened this issue Jun 3, 2020 · 2 comments
Closed

Feature Request: Bash/Zsh Tab Completion #1114

cedricmckinnie opened this issue Jun 3, 2020 · 2 comments
Assignees
Labels
kind/feature New feature or feature request

Comments

@cedricmckinnie
Copy link

Is your feature request related to a problem?
No, it's more of a potential enhancement

Which solution do you suggest?

TLDR: Tab Completions are great. Cobra can generate them

Tab completion can be quite useful as a CLI grows. Support for at least Bash and Zsh would be a good idea.

This might be helpful particularly for the "devspace commands" directive and other directives that require the user to run a separate command like "devspace list" before completing the command that they may be working on.

For an example of a mature CLI that does this, see the Kubectl CLI.

It might also be helpful to collect data using "kubectl get" to complete commands that need to gather information from the current context.

Examples

  1. "devspace " should display the output of "devspace -h" or at least the name of the commands that can be executed.

  2. "devspace list " should display the output of "devspace list -h" or at least the name of the subcommands that can be executed.

  3. "devspace enter " should display the output the list of pods available to enter.

I believe Cobra can generate shell completions automatically:

https://github.com/spf13/cobra/blob/master/bash_completions.md
https://github.com/spf13/cobra/blob/master/zsh_completions.md

Which alternative solutions exist?

Manually building tab completions

Additional context

/kind feature

@FabianKramm
Copy link
Collaborator

@cedricmckinnie thanks for creating this issue! Yes sounds like a good idea, I know the bash completions from kubectl and didn't know cobra could generate them automatically. We can definitely add this

@FabianKramm FabianKramm self-assigned this Jun 4, 2020
@FabianKramm FabianKramm added the kind/feature New feature or feature request label Jun 4, 2020
FabianKramm added a commit to FabianKramm/devspace that referenced this issue Jun 4, 2020
@FabianKramm FabianKramm mentioned this issue Jun 4, 2020
@carlmontanari
Copy link
Contributor

Closing -- resolved in #1116!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or feature request
Projects
None yet
Development

No branches or pull requests

3 participants