From d5a55ae76e412ea46c7a5e357b15ba29c5b8dbdd Mon Sep 17 00:00:00 2001 From: Khosrow Moossavi Date: Sat, 23 Mar 2024 14:26:23 -0400 Subject: [PATCH] more fixes of binary name with missing s Signed-off-by: Khosrow Moossavi --- cmd/completion/completion.go | 18 +++++++++++++----- docs/user-guide/installation.md | 2 +- internal/cli/run.go | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/cmd/completion/completion.go b/cmd/completion/completion.go index 92b995d..1a1b8f8 100644 --- a/cmd/completion/completion.go +++ b/cmd/completion/completion.go @@ -35,17 +35,25 @@ func NewCommand() *cobra.Command { return cmd } -const longDescription = `Outputs terraform-doc shell completion for the given shell (bash, zsh, fish) +const longDescription = `Outputs terraform-docs shell completion for the given shell (bash, zsh, fish) This depends on the bash-completion binary. Example installation instructions: # for bash users - $ terraform-docs completion bash > ~/.terraform-doc-completion - $ source ~/.terraform-doc-completion + $ terraform-docs completion bash > ~/.terraform-docs-completion + $ source ~/.terraform-docs-completion + + # or the one-liner below + + $ source <(terraform-docs completion bash) # for zsh users - % terraform-docs completion zsh > /usr/local/share/zsh/site-functions/_terraform-doc + % terraform-docs completion zsh > /usr/local/share/zsh/site-functions/_terraform-docs % autoload -U compinit && compinit # or if zsh-completion is installed via homebrew - % terraform-docs completion zsh > "${fpath[1]}/_terraform-doc" + % terraform-docs completion zsh > "${fpath[1]}/_terraform-docs" + +# for ohmyzsh + $ terraform-docs completion zsh > ~/.oh-my-zsh/completions/_terraform-docs + $ omz reload # for fish users $ terraform-docs completion fish > ~/.config/fish/completions/terraform-docs.fish diff --git a/docs/user-guide/installation.md b/docs/user-guide/installation.md index 4c63531..cf5d960 100644 --- a/docs/user-guide/installation.md +++ b/docs/user-guide/installation.md @@ -153,7 +153,7 @@ omz reload ### fish ```fish -terraform-doc completion fish > ~/.config/fish/completions/terraform-docs.fish +terraform-docs completion fish > ~/.config/fish/completions/terraform-docs.fish ``` To make this change permanent, the above commands can be added to `~/.profile` file. diff --git a/internal/cli/run.go b/internal/cli/run.go index 0976fc8..690bd2f 100644 --- a/internal/cli/run.go +++ b/internal/cli/run.go @@ -214,7 +214,7 @@ func (r *Runtime) bindFlags(v *viper.Viper) { switch f.Name { case "show", "hide": // If '--show' or '--hide' CLI flag is used, explicitly override and remove - // all items from 'show' and 'hide' set in '.terraform-doc.yml'. + // all items from 'show' and 'hide' set in '.terraform-docs.yml'. if !sectionsCleared { v.Set("sections.show", []string{}) v.Set("sections.hide", []string{})