From c01acba3ce10a74fbc346fbbe9630c23e32fe423 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 11 Jan 2022 15:36:38 +0300 Subject: [PATCH] [#1041] autocomplete: beautify help message Indent sections corresponding to different shells for faster navigation and remove `#` at the line beginning. Signed-off-by: Evgenii Stratonikov --- pkg/util/autocomplete/autocomplete.go | 36 ++++++++++++--------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/pkg/util/autocomplete/autocomplete.go b/pkg/util/autocomplete/autocomplete.go index 5d9083c0b..7f0e0c1bb 100644 --- a/pkg/util/autocomplete/autocomplete.go +++ b/pkg/util/autocomplete/autocomplete.go @@ -10,33 +10,29 @@ import ( const longHelpTemplate = `To load completions: Bash: + $ source <(%s completion bash) -$ source <(%s completion bash) - -# To load completions for each session, execute once: -Linux: + To load completions for each session, execute once: + Linux: $ %s completion bash > /etc/bash_completion.d/%s -MacOS: + MacOS: $ %s completion bash > /usr/local/etc/bash_completion.d/%s Zsh: - -# 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 - -# To load completions for each session, execute once: -$ %s completion zsh > "${fpath[1]}/_%s" - -# You will need to start a new shell for this setup to take effect. + 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 + + To load completions for each session, execute once: + $ %s completion zsh > "${fpath[1]}/_%s" + + You will need to start a new shell for this setup to take effect. Fish: - -$ %s completion fish | source - -# To load completions for each session, execute once: -$ %s completion fish > ~/.config/fish/completions/%s.fish + $ %s completion fish | source + + To load completions for each session, execute once: + $ %s completion fish > ~/.config/fish/completions/%s.fish ` // Command returns cobra command structure for autocomplete routine.