Skip to content

Commit b0fa0e5

Browse files
committed
added shell completion instructions
1 parent 6777d63 commit b0fa0e5

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

cmd/shell_completion.go

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,29 @@ func createBashCompletionCmd(rootCmd *cobra.Command) *cobra.Command {
1313
var completionCmd = &cobra.Command{
1414
Use: "shell-completion",
1515
Short: "Generates shell completion scripts",
16-
Long: `Example usage (for bash): to load completion run
17-
16+
Long: `To load completion for:
17+
bash:
18+
Run
1819
. <(yq bash-completion)
1920
20-
To configure your bash shell to load completions for each session add to your bashrc
21+
To configure your bash shell to load completions for each session add to
22+
your bashrc
2123
2224
# ~/.bashrc or ~/.profile
2325
. <(yq bash-completion)
26+
27+
zsh:
28+
The generated completion script should be put somewhere in your $fpath named _yq
29+
30+
powershell:
31+
Users need PowerShell version 5.0 or above, which comes with Windows 10 and
32+
can be downloaded separately for Windows 7 or 8.1. They can then write the
33+
completions to a file and source this file from their PowerShell profile,
34+
which is referenced by the $Profile environment variable.
35+
36+
fish:
37+
Save the output to a fish file and add it to your completions directory.
38+
2439
`,
2540
RunE: func(cmd *cobra.Command, args []string) error {
2641
switch shellVariant {

0 commit comments

Comments
 (0)