Comments (5)
/assign
Related :
cli/pkg/cmd/completion/completion.go
Lines 46 to 56 in 92d2026
Trying to enable it with :
@@ -34,21 +34,22 @@ Supported Shells:
source bash_completion.sh
`
)
+
func Command() *cobra.Command {
var cmd = &cobra.Command{
Use: "completion SHELL",
Short: "Prints shell completion scripts",
Long: desc,
Args: exactValidArgs(1),
- ValidArgs: []string{"bash"},
+ ValidArgs: []string{"bash", "zsh"},
Example: eg,
RunE: func(cmd *cobra.Command, args []string) error {
switch args[0] {
case "bash":
return cmd.Root().GenBashCompletion(os.Stdout)
- // TODO add zsh completion
- // case "zsh":
- // return cmd.Root().GenZshCompletion(os.Stdout)
+ // TODO add zsh completion
+ case "zsh":
+ return cmd.Root().GenZshCompletion(os.Stdout)
// NOTE: cobra v0.0.3 zsh completion seems fail on zsh 5.5.1
}
return nil
and then inspect the generation from tkn completion zsh
it seems that the completion generated is supposed to go in your fpath and cannot be evaluated directly. If I put in my fpath it would then work as per this screen recording :
https://asciinema.org/a/JbNcp2ftD0Kr2XwvFdsvIl3vF
Kubenertes is doing some nifty trick to be able to do some source <(kubectl completion zsh) with the tail and the head of the generated function :
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/completion/completion.go#L305
We may want to adjust our completion system to do the same
from cli.
/kind enhancement
from cli.
Reading a bit more about this, kubectl is even sneakier, they won't use any of the stuff from cobra GenZSH completion they are doing it via the bashcominit
bash completion to zsh extension, probably because it predate the support of zsh completion in cobra :
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/cmd/completion/completion.go#L302
from cli.
/close
from cli.
@vdemeester: Closing this issue.
In response to this:
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
from cli.
Related Issues (20)
- Update .goreleaser.yaml in order to conform with latest goreleaser changes HOT 3
- `tkn pr logs --follow` doesn't log anything when run non-interactively or in IntelliJ terminal HOT 1
- Reproducible/deterministic bundles
- Build deterministic/reproducible bundles by default
- Support `SOURCE_DATE_EPOCH` in `tkn bundle push`
- "tkn pipeline start --showlog" not exit even after PipelineRun completed HOT 1
- Logs not working on Git Bash on Windows HOT 1
- Support CustomRun resource HOT 3
- hey @stillfox-lee, thanks for taking this up. Feel free to break this issue in multiple issues and assign one to yourself
- Support `CustomRun` list command. HOT 3
- Tkn (in POD) cannot find pipeline resources although they exist HOT 1
- Allow using PipelineRun delete arguments "keep" and "keepSince" together HOT 1
- tkn logs is not displaying tasks defined in the pipeline with 'retries: X'
- checksum of tkn_0.34.0_Linux_x86_64.tar.gz is wrong HOT 8
- support v1 for sign and verify commands HOT 1
- When starting a pipeline with a workspace I get `Error: Name not found for workspace` HOT 2
- Different log output for `tkn p log` and `tkn pr log` HOT 1
- Different log output for `tkn t logs` and `tkn tr logs` HOT 1
- Add support for DisplayName
- Support for providing labels in `tkn bundle push`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cli.