diff options
author | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-11-24 17:42:24 +0900 |
---|---|---|
committer | Naoto Hanaue <hanaue.naoto@po.ntts.co.jp> | 2015-11-26 13:54:35 +0900 |
commit | cfedfe2194693bbee284592599a7cc5210ac755a (patch) | |
tree | 2477f7d72e794c374d2026a90e19f0b2ad6120a4 /tools/completion/gobgp-completion.bash | |
parent | 616608e909c57f1ab6566cac466bdec6d9ef1b9a (diff) |
cli: update bash_complition
Support to the completion of following commands.
- gobgp rpki enable
- gobgp mrt update enable
- disabel
- rotate
- reset
Diffstat (limited to 'tools/completion/gobgp-completion.bash')
-rw-r--r-- | tools/completion/gobgp-completion.bash | 100 |
1 files changed, 98 insertions, 2 deletions
diff --git a/tools/completion/gobgp-completion.bash b/tools/completion/gobgp-completion.bash index e665c0c5..328c6573 100644 --- a/tools/completion/gobgp-completion.bash +++ b/tools/completion/gobgp-completion.bash @@ -285,11 +285,11 @@ __handle_word() { if [[ $c -ge $cword ]]; then __handle_reply - return + return fi __debug "${FUNCNAME}: c is $c words[c] is ${words[c]}" if [[ "${words[c]}" == -* ]]; then - __handle_flag + __handle_flag elif __contains_word "${words[c]}" "${commands[@]}"; then __handle_command else @@ -2142,12 +2142,107 @@ _gobgp_mrt_inject() must_have_one_noun=() } +_gobgp_mrt_update_enable() +{ + last_command="gobgp_mrt_update_enable" + commands=() + + flags=() + two_word_flags=() + flags_with_completion=() + flags_completion=() + + + must_have_one_flag=() + must_have_one_noun=() +} + +_gobgp_mrt_update_disable() +{ + last_command="gobgp_mrt_update_disable" + commands=() + + flags=() + two_word_flags=() + flags_with_completion=() + flags_completion=() + + + must_have_one_flag=() + must_have_one_noun=() +} + +_gobgp_mrt_update_reset() +{ + last_command="gobgp_mrt_update_reset" + commands=() + + flags=() + two_word_flags=() + flags_with_completion=() + flags_completion=() + + + must_have_one_flag=() + must_have_one_noun=() +} + +_gobgp_mrt_update_rotate() +{ + last_command="gobgp_mrt_update_rotate" + commands=() + + flags=() + two_word_flags=() + flags_with_completion=() + flags_completion=() + + + must_have_one_flag=() + must_have_one_noun=() +} + +_gobgp_mrt_update() +{ + last_command="gobgp_mrt_update" + commands=() + commands+=("enable") + commands+=("disable") + commands+=("reset") + commands+=("rotate") + + flags=() + two_word_flags=() + flags_with_completion=() + flags_completion=() + + + must_have_one_flag=() + must_have_one_noun=() +} + _gobgp_mrt() { last_command="gobgp_mrt" commands=() commands+=("dump") commands+=("inject") + commands+=("update") + + flags=() + two_word_flags=() + flags_with_completion=() + flags_completion=() + + + must_have_one_flag=() + must_have_one_noun=() +} + +_gobgp_rpki_enable() +{ + last_command="gobgp_rpki_enable" + commands=() flags=() two_word_flags=() @@ -2195,6 +2290,7 @@ _gobgp_rpki() { last_command="gobgp_rpki" commands=() + commands+=("enable") commands+=("server") commands+=("table") |