From cfedfe2194693bbee284592599a7cc5210ac755a Mon Sep 17 00:00:00 2001 From: Naoto Hanaue Date: Tue, 24 Nov 2015 17:42:24 +0900 Subject: cli: update bash_complition Support to the completion of following commands. - gobgp rpki enable - gobgp mrt update enable - disabel - rotate - reset --- tools/completion/gobgp-completion.bash | 100 ++++++++++++++++++++++++++++++++- 1 file 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") -- cgit v1.2.3