Skip to content

Commit 443f706

Browse files
caarlos0umarcor
authored andcommitted
feat: improve completions help formatting (spf13#1444)
Signed-off-by: Carlos A Becker <[email protected]>
1 parent 58c97f6 commit 443f706

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

completions.go

+25-13
Original file line numberDiff line numberDiff line change
@@ -620,13 +620,18 @@ This script depends on the 'bash-completion' package.
620620
If it is not installed already, you can install it via your OS's package manager.
621621
622622
To load completions in your current shell session:
623-
$ source <(%[1]s completion bash)
623+
624+
source <(%[1]s completion bash)
624625
625626
To load completions for every new session, execute once:
626-
Linux:
627-
$ %[1]s completion bash > /etc/bash_completion.d/%[1]s
628-
MacOS:
629-
$ %[1]s completion bash > /usr/local/etc/bash_completion.d/%[1]s
627+
628+
#### Linux:
629+
630+
%[1]s completion bash > /etc/bash_completion.d/%[1]s
631+
632+
#### macOS:
633+
634+
%[1]s completion bash > /usr/local/etc/bash_completion.d/%[1]s
630635
631636
You will need to start a new shell for this setup to take effect.
632637
`, c.Root().Name()),
@@ -649,13 +654,17 @@ You will need to start a new shell for this setup to take effect.
649654
If shell completion is not already enabled in your environment you will need
650655
to enable it. You can execute the following once:
651656
652-
$ echo "autoload -U compinit; compinit" >> ~/.zshrc
657+
echo "autoload -U compinit; compinit" >> ~/.zshrc
653658
654659
To load completions for every new session, execute once:
655-
# Linux:
656-
$ %[1]s completion zsh > "${fpath[1]}/_%[1]s"
657-
# macOS:
658-
$ %[1]s completion zsh > /usr/local/share/zsh/site-functions/_%[1]s
660+
661+
#### Linux:
662+
663+
%[1]s completion zsh > "${fpath[1]}/_%[1]s"
664+
665+
#### macOS:
666+
667+
%[1]s completion zsh > /usr/local/share/zsh/site-functions/_%[1]s
659668
660669
You will need to start a new shell for this setup to take effect.
661670
`, c.Root().Name()),
@@ -678,10 +687,12 @@ You will need to start a new shell for this setup to take effect.
678687
Long: fmt.Sprintf(`Generate the autocompletion script for the fish shell.
679688
680689
To load completions in your current shell session:
681-
$ %[1]s completion fish | source
690+
691+
%[1]s completion fish | source
682692
683693
To load completions for every new session, execute once:
684-
$ %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish
694+
695+
%[1]s completion fish > ~/.config/fish/completions/%[1]s.fish
685696
686697
You will need to start a new shell for this setup to take effect.
687698
`, c.Root().Name()),
@@ -701,7 +712,8 @@ You will need to start a new shell for this setup to take effect.
701712
Long: fmt.Sprintf(`Generate the autocompletion script for powershell.
702713
703714
To load completions in your current shell session:
704-
PS C:\> %[1]s completion powershell | Out-String | Invoke-Expression
715+
716+
%[1]s completion powershell | Out-String | Invoke-Expression
705717
706718
To load completions for every new session, add the output of the above command
707719
to your powershell profile.

0 commit comments

Comments
 (0)