Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: improve completions help formatting #1444

Merged
merged 1 commit into from
Dec 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 25 additions & 13 deletions completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,18 @@ This script depends on the 'bash-completion' package.
If it is not installed already, you can install it via your OS's package manager.

To load completions in your current shell session:
$ source <(%[1]s completion bash)

source <(%[1]s completion bash)

To load completions for every new session, execute once:
Linux:
$ %[1]s completion bash > /etc/bash_completion.d/%[1]s
MacOS:
$ %[1]s completion bash > /usr/local/etc/bash_completion.d/%[1]s

#### Linux:

%[1]s completion bash > /etc/bash_completion.d/%[1]s

#### macOS:

%[1]s completion bash > /usr/local/etc/bash_completion.d/%[1]s

You will need to start a new shell for this setup to take effect.
`, c.Root().Name()),
Expand All @@ -642,13 +647,17 @@ Generate the autocompletion script for the zsh shell.
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
echo "autoload -U compinit; compinit" >> ~/.zshrc

To load completions for every new session, execute once:
# Linux:
$ %[1]s completion zsh > "${fpath[1]}/_%[1]s"
# macOS:
$ %[1]s completion zsh > /usr/local/share/zsh/site-functions/_%[1]s

#### Linux:

%[1]s completion zsh > "${fpath[1]}/_%[1]s"

#### macOS:

%[1]s completion zsh > /usr/local/share/zsh/site-functions/_%[1]s

You will need to start a new shell for this setup to take effect.
`, c.Root().Name()),
Expand All @@ -672,10 +681,12 @@ You will need to start a new shell for this setup to take effect.
Generate the autocompletion script for the fish shell.

To load completions in your current shell session:
$ %[1]s completion fish | source

%[1]s completion fish | source

To load completions for every new session, execute once:
$ %[1]s completion fish > ~/.config/fish/completions/%[1]s.fish

%[1]s completion fish > ~/.config/fish/completions/%[1]s.fish

You will need to start a new shell for this setup to take effect.
`, c.Root().Name()),
Expand All @@ -696,7 +707,8 @@ You will need to start a new shell for this setup to take effect.
Generate the autocompletion script for powershell.

To load completions in your current shell session:
PS C:\> %[1]s completion powershell | Out-String | Invoke-Expression

%[1]s completion powershell | Out-String | Invoke-Expression

To load completions for every new session, add the output of the above command
to your powershell profile.
Expand Down