summaryrefslogtreecommitdiffhomepage
path: root/tools/completion/gobgp-completion.bash
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-05-11 17:33:26 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-05-11 23:14:48 +0900
commit2ee83547979eebffd9ed1b3e7530958216d1f85d (patch)
tree14efb6385571e44edc4e6c70dc1661ea2cffe047 /tools/completion/gobgp-completion.bash
parent7684e11a49016517a947b2f1cb5d5401cab19d5e (diff)
cli: update bash-completion for commands of policy prefix
Diffstat (limited to 'tools/completion/gobgp-completion.bash')
-rw-r--r--tools/completion/gobgp-completion.bash44
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/completion/gobgp-completion.bash b/tools/completion/gobgp-completion.bash
index acf47858..e4630690 100644
--- a/tools/completion/gobgp-completion.bash
+++ b/tools/completion/gobgp-completion.bash
@@ -91,6 +91,49 @@ _gobgp_neighbor() {
fi
}
+_gobgp_policy_prefix_add(){
+ return
+}
+_gobgp_policy_prefix_del(){
+ local targets="all"
+ local target="$(__search_target "$targets")"
+ if [ -z "$target" ]; then
+ case "$cur" in
+ *)
+ COMPREPLY=( $( compgen -W "${targets[*]}" -- "$cur" ) )
+ ;;
+ esac
+ return
+ fi
+}
+
+_gobgp_policy_prefix(){
+ local targets="add del"
+ local target="$(__search_target "$targets")"
+ if [ -z "$target" ]; then
+ case "$cur" in
+ *)
+ COMPREPLY=( $( compgen -W "${targets[*]}" -- "$cur" ) )
+ ;;
+ esac
+ return
+ fi
+ _gobgp_policy_prefix_${target}
+}
+
+_gobgp_policy() {
+ local targets="prefix"
+ local target="$(__search_target "$targets")"
+ if [ -z "$target" ]; then
+ case "$cur" in
+ *)
+ COMPREPLY=( $( compgen -W "${targets[*]}" -- "$cur" ) )
+ ;;
+ esac
+ return
+ fi
+ _gobgp_policy_${target}
+}
_gobgp_gobgp() {
case "$prev" in
@@ -115,6 +158,7 @@ _gobgp() {
local commands=(
global
neighbor
+ policy
)
COMPREPLY=()