diff options
author | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-07-07 17:12:33 +0900 |
---|---|---|
committer | Hiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp> | 2015-07-08 19:26:03 +0900 |
commit | 4a4e711a0824cf5e970d77bb355818e19876394a (patch) | |
tree | 9fdeffec70a7f8be4b902821f0f42cb7bf8ff3ba /tools/completion | |
parent | e535f1335b770c140d4edd9df288f5ff47e0639f (diff) |
completion: add policy subcommand for neighbor and README.md
Diffstat (limited to 'tools/completion')
-rw-r--r-- | tools/completion/README.md | 42 | ||||
-rw-r--r-- | tools/completion/gobgp-completion.bash | 1 | ||||
-rw-r--r-- | tools/completion/zsh/_gobgp | 1 |
3 files changed, 44 insertions, 0 deletions
diff --git a/tools/completion/README.md b/tools/completion/README.md new file mode 100644 index 00000000..2dbdbb5d --- /dev/null +++ b/tools/completion/README.md @@ -0,0 +1,42 @@ +Completion +======================== + +### bash completion + +1. install bash-completion as follows: + + ``` + % sudo apt-get install bash-completion + ``` + +1. add gobgp's path to PATH environment variable + + If you run 'go get github.com/osrg/gobgp/gobgp', gobgp command is installed in $GOPATH/bin. + ``` + % export PATH=$PATH:$GOPATH/bin + ``` + +1. load completion file + + ``` + % source $GOPATH/src/github.com/osrg/gobgp/tools/completion/gobgp-completion.bash + ``` + +You can use tab completion for gobgp after loading gobgp-completion.bash. + + + +### zsh completion + +zsh completion for gobgp works by adding the path of gobgp zsh completion directory to $fpath and enabling zsh completion like below: + + ``` + % vi ~/.zshrc + + GOBGP_COMP=$GOPATH/src/github.com/osrg/gobgp/tools/completion/zsh + fpath=($GOBGP_COMP $fpath) + + autoload -Uz compinit + compinit + + ```
\ No newline at end of file diff --git a/tools/completion/gobgp-completion.bash b/tools/completion/gobgp-completion.bash index a213d47a..c1c704c1 100644 --- a/tools/completion/gobgp-completion.bash +++ b/tools/completion/gobgp-completion.bash @@ -293,6 +293,7 @@ _gobgp_neighbor_someone() commands+=("shutdown") commands+=("enable") commands+=("disable") + commands+=("policy") flags=() two_word_flags=() diff --git a/tools/completion/zsh/_gobgp b/tools/completion/zsh/_gobgp index 34d78e7e..99689e03 100644 --- a/tools/completion/zsh/_gobgp +++ b/tools/completion/zsh/_gobgp @@ -47,6 +47,7 @@ __neighbor(){ "shutdown" "enable" "disable" + "policy" ) _arguments : \ |