nmcli: manage autocompletion of "nmcli connection add" when no args are passed

This enables back "help" "--help" "-help" in autocompletion.
This commit is contained in:
Francesco Giudici
2016-06-23 14:44:43 +02:00
parent 1f6d060008
commit ea9dcd08fa

View File

@@ -993,8 +993,12 @@ _nmcli()
fi fi
;; ;;
a|ad|add) a|ad|add)
_nmcli_array_delete_at words 0 1 if [[ ${#words[@]} -eq 3 ]]; then
_nmcli_list_nl "$(nmcli --complete-args connection add "${words[@]}" 2>/dev/null)" _nmcli_compl_COMMAND_nl "${words[2]}" "$(nmcli --complete-args connection add "" 2>/dev/null)"
else
_nmcli_array_delete_at words 0 1
_nmcli_list_nl "$(nmcli --complete-args connection add "${words[@]}" 2>/dev/null)"
fi
;; ;;
e|ed|edi|edit) e|ed|edi|edit)
if [[ ${#words[@]} -eq 3 ]]; then if [[ ${#words[@]} -eq 3 ]]; then