summaryrefslogtreecommitdiff
path: root/clients/cli/nmcli-completion
diff options
context:
space:
mode:
Diffstat (limited to 'clients/cli/nmcli-completion')
-rw-r--r--clients/cli/nmcli-completion30
1 files changed, 29 insertions, 1 deletions
diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion
index 6d9b6ae1cb..203a020716 100644
--- a/clients/cli/nmcli-completion
+++ b/clients/cli/nmcli-completion
@@ -863,7 +863,7 @@ _nmcli()
;;
c|co|con|conn|conne|connec|connect|connecti|connectio|connection)
if [[ ${#words[@]} -eq 2 ]]; then
- _nmcli_compl_COMMAND "$command" show up down add modify edit delete reload load
+ _nmcli_compl_COMMAND "$command" show up down add modify clone edit delete reload load
elif [[ ${#words[@]} -gt 2 ]]; then
case "$command" in
s|sh|sho|show)
@@ -1245,6 +1245,34 @@ _nmcli()
return 0
fi
;;
+ c|cl|clo|clon|clone)
+ if [[ ${#words[@]} -eq 3 ]]; then
+ _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" temporary
+ elif [[ ${#words[@]} -gt 3 ]]; then
+ _nmcli_array_delete_at words 0 1
+
+ LONG_OPTIONS=(help temporary)
+ HELP_ONLY_AS_FIRST=1
+ _nmcli_compl_OPTIONS
+ case $? in
+ 0)
+ return 0
+ ;;
+ 1)
+ if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
+ _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")" "${LONG_OPTIONS[@]}"
+ fi
+ return 0
+ ;;
+ esac
+
+ OPTIONS=(id uuid path)
+ _nmcli_compl_ARGS_CONNECTION && return 0
+
+ return 0
+ fi
+ ;;
+
de|del|dele|delet|delete)
if [[ ${#words[@]} -eq 3 ]]; then
_nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")"