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 shell completion #15

Closed
timebertt opened this issue May 22, 2024 · 1 comment · Fixed by #28
Closed

Support shell completion #15

timebertt opened this issue May 22, 2024 · 1 comment · Fixed by #28
Assignees
Labels
enhancement New feature or request

Comments

@timebertt
Copy link
Owner

The plugin should support shell completion to make it easier to use.
This will make kubectl power users feel right at home.

@timebertt timebertt added the enhancement New feature or request label May 22, 2024
@timebertt
Copy link
Owner Author

timebertt commented May 29, 2024

For the plugin to provide shell completion, it needs to add a kubectl_complete-revisions executable on the PATH, see kubernetes/kubernetes#105867 (also see sample-cli-plugin).
The script could be as simple as:

#!/usr/bin/env bash

# Call cobra's built-in __complete command passing all arguments
kubectl revisions __complete "$@"

This is not natively supported by krew right now: kubernetes-sigs/krew#812
In the meantime, https://github.com/marckhouzam/kubectl-plugin_completion can generate a script for this plugin to enable completion.

The revisions plugin should

  • add a description on how to enable shell completion
  • implement cobra's mechanism for completing arguments (ValidArgsFunction and friends)

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

Successfully merging a pull request may close this issue.

1 participant