@@ -35,20 +35,28 @@ func NewCommand() *cobra.Command {
35
35
return cmd
36
36
}
37
37
38
- const longDescription = `Outputs terraform-doc shell completion for the given shell (bash, zsh, fish)
38
+ const longDescription = `Outputs terraform-docs shell completion for the given shell (bash, zsh, fish)
39
39
This depends on the bash-completion binary. Example installation instructions:
40
40
# for bash users
41
- $ terraform-doc completion bash > ~/.terraform-doc-completion
42
- $ source ~/.terraform-doc-completion
41
+ $ terraform-docs completion bash > ~/.terraform-docs-completion
42
+ $ source ~/.terraform-docs-completion
43
+
44
+ # or the one-liner below
45
+
46
+ $ source <(terraform-docs completion bash)
43
47
44
48
# for zsh users
45
- % terraform-doc completion zsh > /usr/local/share/zsh/site-functions/_terraform-doc
49
+ % terraform-docs completion zsh > /usr/local/share/zsh/site-functions/_terraform-docs
46
50
% autoload -U compinit && compinit
47
51
# or if zsh-completion is installed via homebrew
48
- % terraform-doc completion zsh > "${fpath[1]}/_terraform-doc"
52
+ % terraform-docs completion zsh > "${fpath[1]}/_terraform-docs"
53
+
54
+ # for ohmyzsh
55
+ $ terraform-docs completion zsh > ~/.oh-my-zsh/completions/_terraform-docs
56
+ $ omz reload
49
57
50
58
# for fish users
51
- $ terraform-doc completion fish > ~/.config/fish/completions/terraform-docs.fish
59
+ $ terraform-docs completion fish > ~/.config/fish/completions/terraform-docs.fish
52
60
53
61
Additionally, you may want to output the completion to a file and source in your .bashrc
54
62
Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2
0 commit comments