summary refs log tree commit diff
path: root/clients/cli/nmcli-completion
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2016-01-20 16:26:51 +0100
committerMichael Biebl <biebl@debian.org>2016-01-20 16:26:51 +0100
commit494f296a3baab08522617b24b1f126d8f9a17502 (patch)
treec8ef32fb0dd1c4ff35a0b38e787abb58692de0cd /clients/cli/nmcli-completion
parent54f6333410ffd570e62717d9e77c5c987175e397 (diff)
Imported Upstream version 1.1.90 upstream/1.1.90
Diffstat (limited to 'clients/cli/nmcli-completion')
-rw-r--r--clients/cli/nmcli-completion325
1 files changed, 260 insertions, 65 deletions
diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion
index 7bdd5255..f8c0298e 100644
--- a/clients/cli/nmcli-completion
+++ b/clients/cli/nmcli-completion
@@ -187,6 +187,33 @@ _nmcli_compl_OPTIONS()
             show-secrets)
                 _nmcli_array_delete_at words 0
                 ;;
+            order)
+                if [[ "${#words[@]}" -eq 2 ]]; then
+                   local ord="${words[1]}"
+                   local ord_sta=""
+                   local i
+                   local c=()
+
+                   # FIXME: currently the completion considers colon as separator
+                   # for words. Hence the following doesn't work as $ord will
+                   # not contain any colons at this point.
+                   # See https://bugzilla.gnome.org/show_bug.cgi?id=745157
+
+                   if [[ $ord = *":"* ]]; then
+                       ord_sta="${ord%:*}:"
+                       ord="${ord##*:}"
+                   fi
+                   if [[ $ord = [-+]* ]]; then
+                       ord_sta="$ord_sta${ord:0:1}"
+                   fi
+                   for i in active name type path; do
+                       c=("${c[@]}" "$ord_sta$i")
+                   done
+                   _nmcli_list "${c[*]}"
+                   return 0
+                fi
+                _nmcli_array_delete_at words 0 1
+                ;;
             active)
                 _nmcli_array_delete_at words 0
                 ;;
@@ -211,11 +238,18 @@ _nmcli_compl_OPTIONS()
                 fi
                 _nmcli_array_delete_at words 0 1
                 ;;
+            colors)
+                if [[ "${#words[@]}" -eq 2 ]]; then
+                    _nmcli_list "yes no auto"
+                   return 0
+                fi
+                _nmcli_array_delete_at words 0 1
+                ;;
             fields)
                 if [[ "${#words[@]}" -eq 2 ]]; then
                     _nmcli_list "all common
                         NAME UUID TYPE TIMESTAMP TIMESTAMP-REAL AUTOCONNECT READONLY DBUS-PATH ACTIVE DEVICE STATE ACTIVE-PATH
-                        connection 802-3-ethernet 802-1x 802-11-wireless 802-11-wireless-security ipv4 ipv6 serial ppp pppoe gsm cdma bluetooth 802-11-olpc-mesh vpn wimax infiniband bond vlan adsl bridge bridge-port team team-port dcb
+                        connection 802-3-ethernet 802-1x 802-11-wireless 802-11-wireless-security ipv4 ipv6 serial ppp pppoe gsm cdma bluetooth 802-11-olpc-mesh vpn wimax infiniband bond vlan adsl bridge bridge-port team team-port dcb tun ip-tunnel macvlan vxlan
                         GENERAL IP4 DHCP4 IP6 DHCP6 VPN
                         profile active"
                    return 0
@@ -248,6 +282,7 @@ _nmcli_compl_OPTIONS()
 # expects several options with parameters. This function can parse them and remove them from the words array.
 _nmcli_compl_ARGS()
 {
+    local aliases=${@}
     local OPTIONS_ALL N_REMOVE_WORDS REMOVE_OPTIONS OPTIONS_HAS_MANDATORY i
     OPTIONS_ALL=("${OPTIONS[@]}")
     OPTIONS_UNKNOWN_OPTION=
@@ -283,10 +318,20 @@ _nmcli_compl_ARGS()
 
         N_REMOVE_WORDS=2
         REMOVE_OPTIONS=("${words[0]}")
-        case "${words[0]}" in
+
+        # change option name to alias
+        WORD0="${words[0]}"
+        for alias in "${aliases[@]}" ; do
+            if [[ "${WORD0}" == ${alias%%:*} ]]; then
+                WORD0=${alias#*:}
+                break
+            fi
+        done
+
+        case "${WORD0}" in
             level)
                 if [[ "${#words[@]}" -eq 2 ]]; then
-                    _nmcli_list "ERR WARN INFO DEBUG TRACE"
+                    _nmcli_list "OFF ERR WARN INFO DEBUG TRACE"
                    return 0
                 fi
                 ;;
@@ -367,7 +412,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 adsl"
+                        _nmcli_list "ethernet wifi wimax gsm cdma infiniband bluetooth vpn olpc-mesh vlan bond bridge team pppoe adsl tun ip-tunnel macvlan vxlan"
                     fi
                     return 0
                 fi
@@ -428,6 +473,15 @@ _nmcli_compl_ARGS()
                         "wifi")
                             _nmcli_list "infrastructure ap adhoc"
                             ;;
+                        "tun")
+                            _nmcli_list "tun tap"
+                            ;;
+                        "ip-tunnel")
+                            _nmcli_list "ipip gre sit isatap vti ip6ip6 ipip6 ip6gre vti6"
+                            ;;
+                        "macvlan")
+                            _nmcli_list "vepa bridge private passthru source"
+                            ;;
                         "bond"| \
                         *)
                         _nmcli_list "balance-rr active-backup balance-xor broadcast 802.3ad balance-tlb balance-alb"
@@ -447,6 +501,12 @@ _nmcli_compl_ARGS()
                     return 0
                 fi
                 ;;
+            slave-type)
+                if [[ "${#words[@]}" -eq 2 ]]; then
+                    _nmcli_list "bond team bridge"
+                    return 0
+                fi
+                ;;
             lacp-rate)
                 if [[ "${#words[@]}" -eq 2 ]]; then
                     _nmcli_list "slow fast"
@@ -465,12 +525,17 @@ _nmcli_compl_ARGS()
                     return 0
                 fi
                 ;;
+            managed| \
             autoconnect| \
             stp| \
             hairpin| \
             save| \
             hidden| \
-            private)
+            private| \
+            pi| \
+            vnet-hdr| \
+            multi-queue|\
+            tap)
                 if [[ "${#words[@]}" -eq 2 ]]; then
                     _nmcli_list "yes no"
                     return 0
@@ -518,7 +583,8 @@ _nmcli_compl_ARGS()
             username| \
             service| \
             password| \
-            passwd-file)
+            passwd-file| \
+            file)
                 if [[ "${#words[@]}" -eq 2 ]]; then
                     return 0
                 fi
@@ -548,6 +614,12 @@ _nmcli_compl_ARGS()
                     return 0
                 fi
                 ;;
+            band)
+                if [[ "${#words[@]}" -eq 2 ]]; then
+                    _nmcli_list "a bg"
+                    return 0
+                fi
+                ;;
             *)
                 return 1
                 ;;
@@ -581,6 +653,7 @@ _nmcli_compl_ARGS()
 
 # some commands expect a connection as parameter. This connection can either be given
 # as id|uuid|path|apath. Parse that connection parameter.
+# Actually, it can also ask for a device name, like `nmcli device set [ifname] <ifname>`
 _nmcli_compl_ARGS_CONNECTION()
 {
     if ! _nmcli_array_has_value OPTIONS "${words[0]}"; then
@@ -683,6 +756,25 @@ _nmcli_compl_COMMAND_nl() {
     _nmcli_list_nl "$(printf "%s%s\n%s" "" "$V" "$a")"
 }
 
+_nmcli_compl_PROPERTIES()
+{
+    while [[ "${#words[@]}" -gt 0 ]]; do
+        if [[ ${#words[@]} -le 1 ]]; then
+            local PREFIX=""
+
+            if [[ "${words[0]:0:1}" == [+-] ]]; then
+                PREFIX="${words[0]:0:1}"
+            fi
+            _nmcli_list_nl "$(echo -e 'print\nquit\nyes' |nmcli c edit "$@" 2>/dev/null |awk -F: '/\..*:/ {print "'$PREFIX'"$1}')"
+            return 0
+        elif [[ ${#words[@]} -le 2 ]]; then
+            return 0
+        fi
+        _nmcli_array_delete_at words 0 1
+    done
+    _nmcli_list_nl "$(echo -e 'print\nquit\nyes' |nmcli c edit "$@" 2>/dev/null |awk -F: '/\..*:/ {print $1}')"
+}
+
 _nmcli()
 {
     local cur prev words cword i
@@ -707,12 +799,12 @@ _nmcli()
         cur=''
     fi
 
-    local OPTIONS_UNKNOWN_OPTION OPTIONS_TYPE OPTIONS_TYPED OPTIONS OPTIONS_MANDATORY COMMAND_ARGS_WAIT_OPTIONS OPTIONS_IP OPTIONS_MANDATORY OPTIONS_NEXT_GROUP OPTIONS_REPEATABLE
+    local OPTIONS_UNKNOWN_OPTION OPTIONS_TYPE OPTIONS_TYPED OPTIONS OPTIONS_MANDATORY COMMAND_ARGS_WAIT_OPTIONS OPTIONS_IP OPTIONS_MANDATORY OPTIONS_NEXT_GROUP OPTIONS_SEP OPTIONS_REPEATABLE
     local COMMAND_CONNECTION_TYPE COMMAND_CONNECTION_ID OPTIONS_MANDATORY_IFNAME HELP_ONLY_AS_FIRST
     local COMMAND_CONNECTION_ACTIVE=""
 
     HELP_ONLY_AS_FIRST=
-    local LONG_OPTIONS=(terse pretty mode fields escape nocheck ask wait version help)
+    local LONG_OPTIONS=(terse pretty mode fields colors escape nocheck ask show-secrets wait version help)
     _nmcli_compl_OPTIONS
     i=$?
 
@@ -730,7 +822,7 @@ _nmcli()
             # (if the current word starts with a dash) or the OBJECT list
             # otherwise.
             if [[ "${words[0]:0:1}" != '-' ]]; then
-                OPTIONS=(help general networking radio connection device agent)
+                OPTIONS=(help general networking radio connection device agent monitor)
             elif [[ "${words[0]:1:1}" == '-' ||  "${words[0]}" == "-" ]]; then
                 OPTIONS=("${LONG_OPTIONS[@]/#/--}")
             else
@@ -791,10 +883,10 @@ _nmcli()
             ;;
         r|ra|rad|radi|radio)
             if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" all wifi wwan wimax
+                _nmcli_compl_COMMAND "$command" all wifi wwan
             elif [[ ${#words[@]} -eq 3 ]]; then
                 case "$command" in
-                    a|al|all | w|wi|wif|wifi | ww|wwa|wwan | wim|wima|wimax)
+                    a|al|all | w|wi|wif|wifi | ww|wwa|wwan)
                         _nmcli_compl_COMMAND "${words[2]}" "on off"
                         ;;
                 esac
@@ -802,16 +894,16 @@ _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 monitor reload load import export
             elif [[ ${#words[@]} -gt 2 ]]; then
                 case "$command" in
                     s|sh|sho|show)
                         if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME)")" active show-secrets
+                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\napath\n%s" "$(_nmcli_con_show NAME)")" active order
                         elif [[ ${#words[@]} -gt 3 ]]; then
                             _nmcli_array_delete_at words 0 1
 
-                            LONG_OPTIONS=(help active show-secrets)
+                            LONG_OPTIONS=(help active order)
                             HELP_ONLY_AS_FIRST=1
                             _nmcli_compl_OPTIONS
                             i=$?
@@ -910,7 +1002,7 @@ _nmcli()
                         ;;
                     a|ad|add)
                         if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect
+                            _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect master slave-type
                         elif [[ ${#words[@]} -gt 3 ]]; then
                             _nmcli_array_delete_at words 0 1
 
@@ -923,14 +1015,14 @@ _nmcli()
                                     ;;
                                 1)
                                     if [[ "$HELP_ONLY_AS_FIRST" == 1 ]]; then
-                                        _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect
+                                        _nmcli_compl_COMMAND "${words[2]}" type ifname con-name autoconnect master slave-type
                                     fi
                                     return 0
                                     ;;
                             esac
 
                             OPTIONS_TYPE=
-                            OPTIONS=(type ifname con-name autoconnect save)
+                            OPTIONS=(type ifname con-name autoconnect save master slave-type)
                             OPTIONS_MANDATORY=(type ifname)
                             COMMAND_ARGS_WAIT_OPTIONS=1
                             OPTIONS_MANDATORY_IFNAME=1
@@ -951,6 +1043,7 @@ _nmcli()
                             fi
 
                             OPTIONS_IP=(ip4 ip6 gw4 gw6)
+                            OPTIONS_SEP=(--)
                             OPTIONS_MANDATORY=()
                             case "$OPTIONS_TYPE" in
                                 802-3|802-3-|802-3-e|802-3-et|802-3-eth|802-3-ethe|802-3-ether|802-3-ethern|802-3-etherne|802-3-ethernet| \
@@ -994,32 +1087,14 @@ _nmcli()
                                     OPTIONS_TYPE=bond
                                     OPTIONS_TYPED=(mode miimon downdelay updelay arp-interval arp-ip-target primary lacp-rate)
                                     ;;
-                                bond-|bond-s|bond-sl|bond-sla|bond-slav|bond-slave)
-                                    OPTIONS_TYPE=bond-slave
-                                    OPTIONS_TYPED=(master)
-                                    OPTIONS_MANDATORY=(master)
-                                    OPTIONS_IP=()
-                                    ;;
                                 team)
                                     OPTIONS_TYPE=team
                                     OPTIONS_TYPED=(config)
                                     ;;
-                                team-|team-s|team-sl|team-sla|team-slav|team-slave)
-                                    OPTIONS_TYPE=team-slave
-                                    OPTIONS_TYPED=(master config)
-                                    OPTIONS_MANDATORY=(master)
-                                    OPTIONS_IP=()
-                                    ;;
                                 bridge)
                                     OPTIONS_TYPE=bridge
                                     OPTIONS_TYPED=(stp priority forward-delay hello-time max-age ageing-time mac)
                                     ;;
-                                bridge-|bridge-s|bridge-sl|bridge-sla|bridge-slav|bridge-slave)
-                                    OPTIONS_TYPE=bridge-slave
-                                    OPTIONS_TYPED=(master priority path-cost hairpin)
-                                    OPTIONS_MANDATORY=(master)
-                                    OPTIONS_IP=()
-                                    ;;
                                 vp|vpn)
                                     OPTIONS_TYPE=vpn
                                     OPTIONS_TYPED=(vpn-type user)
@@ -1041,6 +1116,26 @@ _nmcli()
                                     OPTIONS_TYPED=(username password protocol encapsulation)
                                     OPTIONS_MANDATORY=(username protocol)
                                     ;;
+                                tu|tun)
+                                    OPTIONS_TYPE=tun
+                                    OPTIONS_TYPED=(mode owner group pi vnet-hdr multi-queue)
+                                    OPTIONS_MANDATORY=(mode)
+                                    ;;
+                                ip|ip-|ip-t|ip-tu|ip-tun|ip-tunn|ip-tunne|ip-tunnel)
+                                    OPTIONS_TYPE=ip-tunnel
+                                    OPTIONS_TYPED=(mode remote local dev)
+                                    OPTIONS_MANDATORY=(mode remote)
+                                    ;;
+                                m|ma|mac|macv|macvl|macvla|macvlan)
+                                    OPTIONS_TYPE=macvlan
+                                    OPTIONS_TYPED=(dev mode tap)
+                                    OPTIONS_MANDATORY=(dev mode)
+                                    ;;
+                                vx|vxl|vxla|vxlan)
+                                    OPTIONS_TYPE=vxlan
+                                    OPTIONS_TYPED=(id remote local dev source-port-min source-port-max destination-port)
+                                    OPTIONS_MANDATORY=(id remote)
+                                    ;;
                                 *)
                                     # for an unknown connection type, we stop completion here
                                     return 0
@@ -1052,7 +1147,7 @@ _nmcli()
                                 if [[ "${#OPTIONS_MANDATORY[@]}" -gt 0 ]]; then
                                     _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_TYPED[@]}")"
                                 else
-                                    _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_TYPED[@]}") $(echo "${OPTIONS_IP[@]}")"
+                                    _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_TYPED[@]}") $(echo "${OPTIONS_IP[@]}") $(echo "${OPTIONS_SEP[@]}")"
                                 fi
                                 return 0
                             fi
@@ -1069,7 +1164,7 @@ _nmcli()
                                     if [[ "${#OPTIONS_MANDATORY[@]}" -gt 0 ]]; then
                                         _nmcli_list "$(echo "${OPTIONS[@]}")"
                                     else
-                                        _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_IP[@]}")"
+                                        _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_IP[@]}") $(echo "${OPTIONS_SEP[@]}")"
                                     fi
                                     return 0
                                 fi
@@ -1080,11 +1175,12 @@ _nmcli()
                                         # we have an unknown option, but still mandatory ones that must be fullfiled first.
                                         return 0
                                     fi
-                                    if ! _nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}"; then
-                                        # the unknown option is NOT an IP option.
+                                    if ! (_nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}" ||
+                                          _nmcli_array_has_value OPTIONS_SEP "${OPTIONS_UNKNOWN_OPTION:1}"); then
+                                        # the unknown option is neither an IP option nor a separator.
                                         return 0
                                     fi
-                                    # The unknown option is an IP option, which is fine... continue...
+                                    # The unknown option is an IP option or a separator, which is fine... continue...
                                 fi
 
                             fi
@@ -1101,8 +1197,9 @@ _nmcli()
                                 fi
 
                                 if [[ "$OPTIONS_UNKNOWN_OPTION" != "" ]]; then
-                                    if ! _nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}"; then
-                                        # the unknown option is NOT an IP option.
+                                    if ! (_nmcli_array_has_value OPTIONS_IP "${OPTIONS_UNKNOWN_OPTION:1}" ||
+                                          _nmcli_array_has_value OPTIONS_SEP "${OPTIONS_UNKNOWN_OPTION:1}"); then
+                                        # the unknown option is neither an IP option nor a separator.
                                         return 0
                                     fi
                                 fi
@@ -1110,8 +1207,8 @@ _nmcli()
 
 
                             # no mandatory options... do final completion including IP options
-                            OPTIONS=("${OPTIONS[@]}" "${OPTIONS_IP[@]}")
-                            OPTIONS_NEXT_GROUP=("${OPTIONS_IP[@]}")
+                            OPTIONS=("${OPTIONS[@]}" "${OPTIONS_IP[@]}" "${OPTIONS_SEP[@]}")
+                            OPTIONS_NEXT_GROUP=("${OPTIONS_IP[@]}" "${OPTIONS_SEP[@]}")
                             _nmcli_compl_ARGS && return 0
 
                             if [[ "$OPTIONS_UNKNOWN_OPTION" != "" ]]; then
@@ -1125,11 +1222,18 @@ _nmcli()
                                 return 0
                             fi
 
+
                             # process the last group of options, as the OPTIONS_TYPED are already handled...
-                            OPTIONS=("${OPTIONS_IP[@]}")
-                            OPTIONS_NEXT_GROUP=()
+                            OPTIONS=("${OPTIONS_IP[@]}" "${OPTIONS_SEP[@]}")
+                            OPTIONS_NEXT_GROUP=("${OPTIONS_SEP[@]}")
                             COMMAND_ARGS_WAIT_OPTIONS=0
                             _nmcli_compl_ARGS && return 0
+
+                            _nmcli_array_delete_at words 0
+                            _nmcli_compl_PROPERTIES type "$OPTIONS_TYPE"
+
+                            return 0
+
                         fi
                         ;;
                     e|ed|edi|edit)
@@ -1186,25 +1290,42 @@ _nmcli()
 
                             OPTIONS=(id uuid path)
                             _nmcli_compl_ARGS_CONNECTION && return 0
-                            while [[ "${#words[@]}" -gt 0 ]]; do
-                                if [[ ${#words[@]} -le 1 ]]; then
-                                    local PREFIX=""
 
-                                    if [[ "${words[0]:0:1}" == [+-] ]]; then
-                                        PREFIX="${words[0]:0:1}"
-                                    fi
-                                    _nmcli_list_nl "$(nmcli --fields profile connection show ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/'$PREFIX'\1/p')"
+                            _nmcli_compl_PROPERTIES ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID"
+
+                            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
-                                elif [[ ${#words[@]} -le 2 ]]; then
+                                    ;;
+                                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
-                                fi
-                                _nmcli_array_delete_at words 0 1
-                            done
-                            _nmcli_list_nl "$(nmcli --fields profile connection show ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')"
+                                    ;;
+                            esac
+
+                            OPTIONS=(id uuid path)
+                            _nmcli_compl_ARGS_CONNECTION && return 0
+
                             return 0
                         fi
                         ;;
-                    de|del|dele|delet|delete)
+
+                    de|del|dele|delet|delete| \
+                    m|mo|mon|moni|monit|monito|monitor)
                         if [[ ${#words[@]} -eq 3 ]]; then
                             _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")"
                         elif [[ ${#words[@]} -gt 3 ]]; then
@@ -1238,12 +1359,67 @@ _nmcli()
                             COMPREPLY=()
                         fi
                         ;;
+                    i|im|imp|impo|impor|import)
+                        if [[ ${#words[@]} -eq 3 ]]; then
+                            _nmcli_compl_COMMAND "${words[2]}" type file --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 "${words[2]}" type file
+                                    fi
+                                    return 0
+                                    ;;
+                            esac
+
+                            OPTIONS=(type file)
+                            OPTIONS_MANDATORY=(type file)
+                            ALIASES=("type:vpn-type")
+                            _nmcli_compl_ARGS ${ALIASES[@]}
+                            return 0
+                        fi
+                        ;;
+                    e|ex|exp|expo|expor|export)
+                        if [[ ${#words[@]} -eq 3 ]]; then
+                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "id\nuuid\npath\n%s" "$(_nmcli_con_show NAME)")"
+                        elif [[ ${#words[@]} -gt 3 ]]; then
+                            _nmcli_array_delete_at words 0 1
+
+                            LONG_OPTIONS=(help)
+                            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
+                        ;;
+
                 esac
             fi
             ;;
         d|de|dev|devi|devic|device)
             if [[ ${#words[@]} -eq 2 ]]; then
-                _nmcli_compl_COMMAND "$command" status show connect disconnect delete wifi wimax
+                _nmcli_compl_COMMAND "$command" status show connect reapply disconnect delete monitor wifi set lldp
             elif [[ ${#words[@]} -gt 2 ]]; then
                 case "$command" in
                     s|st|sta|stat|statu|status)
@@ -1257,15 +1433,28 @@ _nmcli()
                             _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)"
                         fi
                         ;;
+                    r|re|rea|reap|reapp|reappl|reapply| \
                     d|di|dis|disc|disco|discon|disconn|disconne|disconnec|disconnect| \
-                    de|del|dele|delet|delete)
+                    de|del|dele|delet|delete| \
+                    m|mo|mon|moni|monit|monito|monitor)
                         if [[ ${#words[@]} -ge 3 ]]; then
                             _nmcli_compl_COMMAND_nl "${words[2]}" "$(_nmcli_dev_status DEVICE)"
                         fi
                         ;;
+                    se|set)
+                        if [[ ${#words[@]} -eq 3 ]]; then
+                            _nmcli_compl_COMMAND_nl "${words[2]}" "$(printf "ifname\n%s" "$(_nmcli_dev_status DEVICE)")"
+                        else
+                            _nmcli_array_delete_at words 0 1
+                            OPTIONS=(ifname)
+                            _nmcli_compl_ARGS_CONNECTION && return 0
+                            OPTIONS=(autoconnect managed)
+                            _nmcli_compl_ARGS
+                        fi
+                        ;;
                     w|wi|wif|wifi)
                         if [[ ${#words[@]} -eq 3 ]]; then
-                            _nmcli_compl_COMMAND "${words[2]}" list connect rescan
+                            _nmcli_compl_COMMAND "${words[2]}" list connect hotspot rescan
                         else
                             case "${words[2]}" in
                                 l|li|lis|list)
@@ -1286,6 +1475,11 @@ _nmcli()
                                         _nmcli_compl_ARGS
                                     fi
                                     ;;
+                                h|ho|hot|hots|hotsp|hotspo|hotspot)
+                                    _nmcli_array_delete_at words 0 2
+                                    OPTIONS=(ifname con-name ssid band channel password)
+                                    _nmcli_compl_ARGS
+                                    ;;
                                 r|re|res|resc|resca|rescan)
                                     _nmcli_array_delete_at words 0 2
                                     OPTIONS_REPEATABLE=(ssid)
@@ -1295,20 +1489,19 @@ _nmcli()
                             esac
                         fi
                         ;;
-                    wim|wima|wimax)
+                    l|ll|lld|lldp)
                         if [[ ${#words[@]} -eq 3 ]]; then
                             _nmcli_compl_COMMAND "${words[2]}" list
                         else
                             case "${words[2]}" in
                                 l|li|lis|list)
                                     _nmcli_array_delete_at words 0 2
-                                    OPTIONS=(ifname nsp)
+                                    OPTIONS=(ifname)
                                     _nmcli_compl_ARGS
                                     ;;
                             esac
                         fi
                         ;;
-
                 esac
             fi
             ;;
@@ -1317,6 +1510,8 @@ _nmcli()
                 _nmcli_compl_COMMAND "$command" secret polkit all
             fi
             ;;
+        m|mo|mon|moni|monit|monito|monitor)
+            ;;
     esac
 
     return 0