Skip to content

Commit 77d395a

Browse files
authored
Merge pull request #740 from lbdemv/update-docstring-bash-completion
Fixed binary name in description output of bash completion generation cli command
2 parents 9e81dc2 + d5a55ae commit 77d395a

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

cmd/completion/completion.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,28 @@ func NewCommand() *cobra.Command {
3535
return cmd
3636
}
3737

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)
3939
This depends on the bash-completion binary. Example installation instructions:
4040
# 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)
4347
4448
# 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
4650
% autoload -U compinit && compinit
4751
# 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
4957
5058
# 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
5260
5361
Additionally, you may want to output the completion to a file and source in your .bashrc
5462
Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2

docs/user-guide/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ omz reload
153153
### fish
154154

155155
```fish
156-
terraform-doc completion fish > ~/.config/fish/completions/terraform-docs.fish
156+
terraform-docs completion fish > ~/.config/fish/completions/terraform-docs.fish
157157
```
158158

159159
To make this change permanent, the above commands can be added to `~/.profile` file.

internal/cli/run.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (r *Runtime) bindFlags(v *viper.Viper) {
214214
switch f.Name {
215215
case "show", "hide":
216216
// If '--show' or '--hide' CLI flag is used, explicitly override and remove
217-
// all items from 'show' and 'hide' set in '.terraform-doc.yml'.
217+
// all items from 'show' and 'hide' set in '.terraform-docs.yml'.
218218
if !sectionsCleared {
219219
v.Set("sections.show", []string{})
220220
v.Set("sections.hide", []string{})

0 commit comments

Comments
 (0)