nmcli-completion: complete filename for VPN import and passwd-file

Also hard-code the VPN types strongswan and fortisslvpn.

https://bugzilla.redhat.com/show_bug.cgi?id=1337300
This commit is contained in:
Thomas Haller
2016-05-19 09:40:44 +02:00
parent e0e1c59160
commit 09a015b23b

View File

@@ -494,7 +494,7 @@ _nmcli_compl_ARGS()
;; ;;
vpn-type) vpn-type)
if [[ "${#words[@]}" -eq 2 ]]; then if [[ "${#words[@]}" -eq 2 ]]; then
_nmcli_list "vpnc openvpn pptp openconnect openswan libreswan ssh l2tp iodine" _nmcli_list "vpnc openvpn pptp openconnect openswan libreswan strongswan ssh l2tp iodine fortisslvpn"
return 0 return 0
fi fi
;; ;;
@@ -579,10 +579,16 @@ _nmcli_compl_ARGS()
user| \ user| \
username| \ username| \
service| \ service| \
password| \ password)
if [[ "${#words[@]}" -eq 2 ]]; then
return 0
fi
;;
passwd-file| \ passwd-file| \
file) file)
if [[ "${#words[@]}" -eq 2 ]]; then if [[ "${#words[@]}" -eq 2 ]]; then
compopt -o default
COMPREPLY=()
return 0 return 0
fi fi
;; ;;
@@ -1379,8 +1385,7 @@ _nmcli()
OPTIONS=(type file) OPTIONS=(type file)
OPTIONS_MANDATORY=(type file) OPTIONS_MANDATORY=(type file)
ALIASES=("type:vpn-type") _nmcli_compl_ARGS type:vpn-type
_nmcli_compl_ARGS ${ALIASES[@]}
return 0 return 0
fi fi
;; ;;