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

fix zsh completion output #1014

Merged
merged 2 commits into from
Mar 15, 2022
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
2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ Zsh:
$ echo "autoload -U compinit; compinit" >> ~/.zshrc

# To load completions for each session, execute once:
$ k3d completion zsh > "${fpath[1]}/k3d"
$ k3d completion zsh > "${fpath[1]}/_k3d"

# You will need to start a new shell for this setup to take effect.

Expand Down
42 changes: 20 additions & 22 deletions docs/usage/commands/k3d_completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,41 +8,40 @@ To load completions:

Bash:

$ source <(k3d completion bash)
$ source <(k3d completion bash)

# To load completions for each session, execute once:
# Linux:
$ k3d completion bash > /etc/bash_completion.d/k3d
# macOS:
$ k3d completion bash > /usr/local/etc/bash_completion.d/k3d
# To load completions for each session, execute once:
# Linux:
$ k3d completion bash > /etc/bash_completion.d/k3d
# macOS:
$ k3d completion bash > /usr/local/etc/bash_completion.d/k3d

Zsh:

# If shell completion is not already enabled in your environment,
# you will need to enable it. You can execute the following once:
# If shell completion is not already enabled in your environment,
# you will need to enable it. You can execute the following once:

$ echo "autoload -U compinit; compinit" >> ~/.zshrc
$ echo "autoload -U compinit; compinit" >> ~/.zshrc

# To load completions for each session, execute once:
$ k3d completion zsh > "${fpath[1]}/k3d"
# To load completions for each session, execute once:
$ k3d completion zsh > "${fpath[1]}/_k3d"

# You will need to start a new shell for this setup to take effect.
# You will need to start a new shell for this setup to take effect.

fish:

$ k3d completion fish | source
$ k3d completion fish | source

# To load completions for each session, execute once:
$ k3d completion fish > ~/.config/fish/completions/k3d.fish
# To load completions for each session, execute once:
$ k3d completion fish > ~/.config/fish/completions/k3d.fish

PowerShell:

PS> k3d completion powershell | Out-String | Invoke-Expression

# To load completions for every new session, run:
PS> k3d completion powershell > k3d.ps1
# and source this file from your PowerShell profile.
PS> k3d completion powershell | Out-String | Invoke-Expression

# To load completions for every new session, run:
PS> k3d completion powershell > k3d.ps1
# and source this file from your PowerShell profile.

```
k3d completion SHELL
Expand All @@ -64,5 +63,4 @@ k3d completion SHELL

### SEE ALSO

* [k3d](k3d.md) - https://k3d.io/ -> Run k3s in Docker!

* [k3d](k3d.md) - <https://k3d.io/> -> Run k3s in Docker!