diff options
| author | Michael Biebl <biebl@debian.org> | 2015-11-24 00:06:32 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2015-11-24 00:06:32 +0100 |
| commit | a6ece1a2aa19a6268335c87d4fdef20123dd04a5 (patch) | |
| tree | 87f1961faacdfafb1c4fee5f2feb6bcb5c06813b /clients/cli/nmcli-completion | |
| parent | 81836c2d44802b4cca833d7775dd627e0797a7e2 (diff) | |
Imported Upstream version 1.0.8 upstream/1.0.8
Diffstat (limited to 'clients/cli/nmcli-completion')
| -rw-r--r-- | clients/cli/nmcli-completion | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion index 4146eae0..7bdd5255 100644 --- a/clients/cli/nmcli-completion +++ b/clients/cli/nmcli-completion @@ -41,6 +41,20 @@ _nmcli_list_nl() fi (( i++ )) done + + # Work-around bash_completion issue where bash interprets a colon + # as a separator. + # Colon is escaped here. Change "\\:" back to ":". + # See also: + # http://stackoverflow.com/questions/28479216/how-to-give-correct-suggestions-to-tab-complete-when-my-words-contains-colons + # http://stackoverflow.com/questions/2805412/bash-completion-for-maven-escapes-colon/12495727 + i=0 + for entry in ${COMPREPLY[*]} + do + entry="${entry//\\\\:/:}" + COMPREPLY[$i]=${entry} + (( i++ )) + done } _nmcli_con_show() @@ -353,7 +367,7 @@ _nmcli_compl_ARGS() # user friendly. Only complete them, if the current word already starts with an "8". _nmcli_list "802-3-ethernet 802-11-wireless 802-11-olpc-mesh" else - _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bond-slave bridge bridge-slave team team-slave pppoe" + _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bond-slave bridge bridge-slave team team-slave pppoe adsl" fi return 0 fi @@ -522,6 +536,18 @@ _nmcli_compl_ARGS() return 0 fi ;; + encapsulation) + if [[ "${#words[@]}" -eq 2 ]]; then + _nmcli_list "vcmux llc" + return 0 + fi + ;; + protocol) + if [[ "${#words[@]}" -eq 2 ]]; then + _nmcli_list "pppoa pppoe ipoatm" + return 0 + fi + ;; *) return 1 ;; @@ -1010,6 +1036,11 @@ _nmcli() OPTIONS_TYPED=(username password service mtu mac) OPTIONS_MANDATORY=(username) ;; + a|ad|ads|adsl) + OPTIONS_TYPE=adsl + OPTIONS_TYPED=(username password protocol encapsulation) + OPTIONS_MANDATORY=(username protocol) + ;; *) # for an unknown connection type, we stop completion here return 0 |