Skip to content

Commit

Permalink
Corrected completion docs
Browse files Browse the repository at this point in the history
  • Loading branch information
fredericlemoine committed Jul 13, 2018
1 parent 7243e61 commit 1acac9b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,15 @@ The `gotree` executable should be located in the `$GOPATH/bin` folder.
```
# MacOS brew
brew install bash-completion
# MacOS port
port install bash-completion
# MacOS port (do not forget to change
# the path to bash command in terminal
# preferences to /opt/local/bin/bash -l)
sudo port install bash-completion
# Linux /centos
yum install bash-completion -y
# Linux /ubuntu
apt-get install bash-completion
```
Expand Down
10 changes: 9 additions & 1 deletion cmd/autocomplete.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,16 @@ Examples (Largely inspired from kubectl command):
# Then add auto completion commands
gotree completion bash > $(brew --prefix)/etc/bash_completion.d/gotree
# bash completion on macOS using macports
## If running Bash 3.2 included with macOS
Change path to bash in Terminal preferences/path to shell:
/opt/local/bin/bash -l
## Then in stall bash-completion
sudo port install bash-completion
# Finally add auto completion commands
gotree completion bash > $(brew --prefix)/etc/bash_completion.d/gotree
# Installing bash completion on Linux
# bash completion on Linux
## Load the gotree completion code for bash into the current shell
source <(gotree completion bash)
## Write bash completion code to a file and source if from .bash_profile
Expand Down
8 changes: 6 additions & 2 deletions docs/commands/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ Usage:
#### Bash
* Install bash-completion:
```
# MacOS
# MacOS brew
brew install bash-completion
# MacOS port (do not forget to change
# the path to bash command in terminal
# preferences to /opt/local/bin/bash -l)
sudo port install bash-completion
# Linux
yum install bash-completion -y
apt-get install bash-completion
Expand All @@ -39,7 +43,7 @@ source '$HOME/.gotree/completion.bash.inc'

```
# Once
source <(kubectl completion zsh)
source <(gotree completion zsh)
# Permanently
gotree completion zsh > "${fpath[1]}/_gotree"
```

0 comments on commit 1acac9b

Please sign in to comment.