completion

Output shell completion code for the specified shell (bash, zsh or fish).

Examples

  1. # bash <= 3.2:
  2. # To load shell completion into your current shell session
  3. source /dev/stdin <<< "$(linkerd completion bash)"
  4. # bash >= 4.0:
  5. source <(linkerd completion bash)
  6. # To load shell completion for every shell session
  7. # bash <= 3.2 on osx:
  8. brew install bash-completion # ensure you have bash-completion 1.3+
  9. linkerd completion bash > $(brew --prefix)/etc/bash_completion.d/linkerd
  10. # bash >= 4.0 on osx:
  11. brew install bash-completion@2
  12. linkerd completion bash > $(brew --prefix)/etc/bash_completion.d/linkerd
  13. # bash >= 4.0 on linux:
  14. linkerd completion bash > /etc/bash_completion.d/linkerd
  15. # You will need to start a new shell for this setup to take effect.
  16. # zsh:
  17. # If shell completion is not already enabled in your environment you will need
  18. # to enable it. You can execute the following once:
  19. echo "autoload -U compinit && compinit" >> ~/.zshrc
  20. # create a linkerd 'plugins' folder and add it to your $fpath
  21. mkdir $ZSH/plugins/linkerd && echo "fpath=($ZSH/plugins/linkerd $fpath)" >> ~/.zshrc
  22. # To load completions for each session, execute once:
  23. linkerd completion zsh > "${fpath[1]}/_linkerd" && exec $SHELL
  24. # You will need to start a new shell for this setup to take effect.
  25. # fish:
  26. linkerd completion fish | source
  27. # To load fish shell completions for each session, execute once:
  28. linkerd completion fish > ~/.config/fish/completions/linkerd.fish