Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/cmd/kn.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Manage your Knative building blocks:

### SEE ALSO

* [kn completion](kn_completion.md) - Output shell completion code
* [kn plugin](kn_plugin.md) - Plugin command group
* [kn revision](kn_revision.md) - Revision command group
* [kn route](kn_route.md) - Route command group
Expand Down
47 changes: 47 additions & 0 deletions docs/cmd/kn_completion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## kn completion

Output shell completion code

### Synopsis


This command prints shell completion code which needs to be evaluated
to provide interactive completion

Supported Shells:
- bash
- zsh

```
kn completion [SHELL] [flags]
```

### Examples

```

# Generate completion code for bash
source <(kn completion bash)

# Generate completion code for zsh
source <(kn completion zsh)
```

### Options

```
-h, --help help for completion
```

### Options inherited from parent commands

```
--config string kn config file (default is $HOME/.kn/config.yaml)
--kubeconfig string kubectl config file (default is $HOME/.kube/config)
--log-http log http traffic
```

### SEE ALSO

* [kn](kn.md) - Knative client

3 changes: 1 addition & 2 deletions pkg/kn/commands/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

const (
desc = `
This command prints shell completion code which need to be evaluated
This command prints shell completion code which needs to be evaluated
to provide interactive completion

Supported Shells:
Expand All @@ -47,7 +47,6 @@ func NewCompletionCommand(p *commands.KnParams) *cobra.Command {
Long: desc,
ValidArgs: []string{"bash", "zsh"},
Example: eg,
Hidden: true, // Don't show this in help listing
Run: func(cmd *cobra.Command, args []string) {
if len(args) == 1 {
switch args[0] {
Expand Down