summaryrefslogtreecommitdiffhomepage
path: root/tools/completion/gobgp-completion.bash
diff options
context:
space:
mode:
authorNaoto Hanaue <hanaue.naoto@po.ntts.co.jp>2015-06-30 19:37:40 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-01 21:27:31 +0900
commit2c976c061ba93285d017db4dc9210c79130ab063 (patch)
tree02175d8a0dc97954ace3c87f17e123b7ef235f6d /tools/completion/gobgp-completion.bash
parentc9d9a6825c9fe629b069205e2a73836047a7eb3c (diff)
cli: update bash completion
Diffstat (limited to 'tools/completion/gobgp-completion.bash')
-rw-r--r--tools/completion/gobgp-completion.bash80
1 files changed, 78 insertions, 2 deletions
diff --git a/tools/completion/gobgp-completion.bash b/tools/completion/gobgp-completion.bash
index 779205fe..a213d47a 100644
--- a/tools/completion/gobgp-completion.bash
+++ b/tools/completion/gobgp-completion.bash
@@ -195,8 +195,7 @@ __handle_word()
__handle_reply
return
fi
- # __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
- # echo "${FUNCNAME}: c is $c words[c] is ${words[c]} cword is ${cword}"
+ __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
if [[ "${words[c]}" == -* ]]; then
__handle_flag
elif __contains_word "${words[c]}" "${commands[@]}"; then
@@ -313,6 +312,7 @@ _gobgp_neighbor()
{
last_command="gobgp_neighbor"
commands=()
+
flags=()
two_word_flags=()
flags_with_completion=()
@@ -642,6 +642,7 @@ _gobgp_policy_routepolicy_add_state()
flags_completion=()
flags+=("--a-community=")
+ flags+=("--a-med=")
flags+=("--a-route=")
flags+=("--c-aslen=")
flags+=("--c-aspath=")
@@ -669,6 +670,7 @@ _gobgp_policy_routepolicy_add()
flags_completion=()
flags+=("--a-community=")
+ flags+=("--a-med=")
flags+=("--a-route=")
flags+=("--c-aslen=")
flags+=("--c-aspath=")
@@ -763,6 +765,77 @@ _gobgp_policy()
must_have_one_noun=()
}
+_gobgp_monitor_global_rib()
+{
+ last_command="gobgp_monitor_global_rib"
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--help")
+ flags+=("-h")
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+}
+
+_gobgp_monitor_global()
+{
+ last_command="gobgp_monitor_global"
+ commands=()
+ commands+=("rib")
+
+ flags=()
+ two_word_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--help")
+ flags+=("-h")
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+}
+
+_gobgp_monitor_neighbor()
+{
+ last_command="gobgp_monitor_neighbor"
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--help")
+ flags+=("-h")
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+}
+
+_gobgp_monitor()
+{
+ last_command="gobgp_monitor"
+ commands=()
+ commands+=("global")
+ commands+=("neighbor")
+
+ flags=()
+ two_word_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--help")
+ flags+=("-h")
+
+ must_have_one_flag=()
+ must_have_one_noun=()
+}
+
_gobgp_help()
{
last_command="gobgp_help"
@@ -790,6 +863,8 @@ _gobgp()
commands+=("global")
commands+=("neighbor")
commands+=("policy")
+ commands+=("monitor")
+ commands+=("help")
flags=()
two_word_flags=()
@@ -820,6 +895,7 @@ __start_gobgp()
{
local cur prev words cword
_init_completion -s || return
+
local c=0
local flags=()
local two_word_flags=()