[#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 <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-01-11 15:36:38 +03:00 committed by Alex Vanin
parent efabffbfd0
commit c01acba3ce

View file

@ -10,33 +10,29 @@ import (
const longHelpTemplate = `To load completions: const longHelpTemplate = `To load completions:
Bash: 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 $ %s completion bash > /etc/bash_completion.d/%s
MacOS: MacOS:
$ %s completion bash > /usr/local/etc/bash_completion.d/%s $ %s completion bash > /usr/local/etc/bash_completion.d/%s
Zsh: Zsh:
If shell completion is not already enabled in your environment you will need
# If shell completion is not already enabled in your environment you will need to enable it. You can execute the following once:
# 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:
$ %s completion zsh > "${fpath[1]}/_%s"
# 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.
# You will need to start a new shell for this setup to take effect.
Fish: Fish:
$ %s completion fish | source
$ %s completion fish | source
To load completions for each session, execute once:
# To load completions for each session, execute once: $ %s completion fish > ~/.config/fish/completions/%s.fish
$ %s completion fish > ~/.config/fish/completions/%s.fish
` `
// Command returns cobra command structure for autocomplete routine. // Command returns cobra command structure for autocomplete routine.