diff --git a/cli/cmd/completion.go b/cli/cmd/completion.go index a19bf2ce7c926..28fb3f9ca1184 100644 --- a/cli/cmd/completion.go +++ b/cli/cmd/completion.go @@ -11,26 +11,31 @@ import ( // newCmdCompletion creates a new cobra command `completion` which contains commands for // enabling linkerd auto completion func newCmdCompletion() *cobra.Command { - example := ` # bash <= 3.2 + example := ` # bash <= 3.2: source /dev/stdin <<< "$(linkerd completion bash)" - # bash >= 4.0 + # bash >= 4.0: source <(linkerd completion bash) - # bash <= 3.2 on osx + # bash <= 3.2 on osx: brew install bash-completion # ensure you have bash-completion 1.3+ linkerd completion bash > $(brew --prefix)/etc/bash_completion.d/linkerd - # bash >= 4.0 on osx + # bash >= 4.0 on osx: brew install bash-completion@2 linkerd completion bash > $(brew --prefix)/etc/bash_completion.d/linkerd - # zsh - source <(linkerd completion zsh) + # zsh: + # If shell completion is not already enabled in your environment you will need + # to enable it. You can execute the following once: - # zsh on osx / oh-my-zsh + echo "autoload -U compinit; compinit" >> ~/.zshrc + + # To load completions for each session, execute once: linkerd completion zsh > "${fpath[1]}/_linkerd" + # You will need to start a new shell for this setup to take effect. + # fish: linkerd completion fish | source diff --git a/cli/cmd/root.go b/cli/cmd/root.go index c3d31ad1711d3..5480550355a2c 100644 --- a/cli/cmd/root.go +++ b/cli/cmd/root.go @@ -97,7 +97,7 @@ var RootCmd = &cobra.Command{ func init() { defaultNamespace = getDefaultNamespace() - RootCmd.PersistentFlags().StringVarP(&controlPlaneNamespace, "linkerd-namespace", "L", defaultLinkerdNamespace, "Namespace in which Linkerd is installed [$LINKERD_NAMESPACE]") + RootCmd.PersistentFlags().StringVarP(&controlPlaneNamespace, "linkerd-namespace", "L", defaultLinkerdNamespace, "Namespace in which Linkerd is installed ($LINKERD_NAMESPACE)") RootCmd.PersistentFlags().StringVarP(&cniNamespace, "cni-namespace", "", defaultCNINamespace, "Namespace in which the Linkerd CNI plugin is installed") RootCmd.PersistentFlags().StringVar(&kubeconfigPath, "kubeconfig", "", "Path to the kubeconfig file to use for CLI requests") RootCmd.PersistentFlags().StringVar(&kubeContext, "context", "", "Name of the kubeconfig context to use")