Skip to content
Permalink
Browse files

Merge pull request #17 from dpordomingo/patch-1

Explain better how to install completion script
  • Loading branch information...
smola committed Aug 21, 2019
2 parents b3f24f7 + 029cbd2 commit f9dec40d74d83b8de959e23a00079340e77bac70
Showing with 9 additions and 4 deletions.
  1. +4 −2 completion.go
  2. +5 −2 completion_test.go
@@ -22,7 +22,7 @@ func InitCompletionCommand(appname string) func(*flags.Command) {
t := template.Must(template.New("desc").Parse(
`Print a bash completion script for {{.Name}}.
You can place it on /etc/bash_completion.d/{{.Name}}, or add it to your .bashrc:
You can place it on /etc/bash_completion.d/{{.Name}}, or add it to your .bashrc running:
echo "source <({{.Name}} completion)" >> ~/.bashrc
`))

@@ -37,7 +37,9 @@ func (c CompletionCommand) Execute(args []string) error {
t := template.Must(template.New("completion").Parse(
`# Save this file to /etc/bash_completion.d/{{.Name}}
#
# or add the following line to your .bashrc file:
# or add the following line to your .bashrc file:
# source <({{.Name}} completion)
# running:
# echo "source <({{.Name}} completion)" >> ~/.bashrc
_completion-{{.Name}}() {
@@ -31,7 +31,9 @@ func TestCompletionCommand(t *testing.T) {
require.Equal(
`# Save this file to /etc/bash_completion.d/test
#
# or add the following line to your .bashrc file:
# or add the following line to your .bashrc file:
# source <(test completion)
# running:
# echo "source <(test completion)" >> ~/.bashrc
_completion-test() {
@@ -77,7 +79,8 @@ func TestCompletionHelpCommand(t *testing.T) {
Print a bash completion script for test.
You can place it on /etc/bash_completion.d/test, or add it to your .bashrc:
You can place it on /etc/bash_completion.d/test, or add it to your .bashrc
running:
echo "source <(test completion)" >> ~/.bashrc

0 comments on commit f9dec40

Please sign in to comment.
You can’t perform that action at this time.