cli: make bash-completion support abbreviated object names.
nmcli accepts abbreviated versions of object names, e.g. 'con' instead of 'connection'. Adjust bash completion to also support this. Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:

committed by
Dan Williams

parent
6e6b573383
commit
faa6a12ba3
@@ -171,7 +171,7 @@ _nmcli()
|
|||||||
[[ $command == help ]] && return 0
|
[[ $command == help ]] && return 0
|
||||||
|
|
||||||
case $object in
|
case $object in
|
||||||
general)
|
g|ge|gen|gene|gener|genera|general)
|
||||||
case $command in
|
case $command in
|
||||||
status | permissions)
|
status | permissions)
|
||||||
return 0
|
return 0
|
||||||
@@ -185,7 +185,7 @@ _nmcli()
|
|||||||
_nmcli_list "status permissions logging help"
|
_nmcli_list "status permissions logging help"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
networking)
|
n|ne|net|netw|netwo|networ|network|networki|networkin|networking)
|
||||||
case $command in
|
case $command in
|
||||||
on | off)
|
on | off)
|
||||||
return 0
|
return 0
|
||||||
@@ -194,7 +194,7 @@ _nmcli()
|
|||||||
_nmcli_list "on off help"
|
_nmcli_list "on off help"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
radio)
|
r|ra|rad|radi|radio)
|
||||||
case $command in
|
case $command in
|
||||||
all | wifi | mobile | wimax)
|
all | wifi | mobile | wimax)
|
||||||
_nmcli_list "on off"
|
_nmcli_list "on off"
|
||||||
@@ -205,7 +205,7 @@ _nmcli()
|
|||||||
_nmcli_list "all wifi mobile wimax help"
|
_nmcli_list "all wifi mobile wimax help"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
connection)
|
c|co|con|conn|conne|connec|connect|connecti|connectio|connection)
|
||||||
case $command in
|
case $command in
|
||||||
show)
|
show)
|
||||||
local subcommand=${words[3]}
|
local subcommand=${words[3]}
|
||||||
@@ -257,7 +257,7 @@ _nmcli()
|
|||||||
_nmcli_list "show up down add modify edit delete reload help"
|
_nmcli_list "show up down add modify edit delete reload help"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
device)
|
d|de|dev|devi|devic|device)
|
||||||
case $command in
|
case $command in
|
||||||
show)
|
show)
|
||||||
_nmcli_list_nl "$(_nmcli_NM_devices)"
|
_nmcli_list_nl "$(_nmcli_NM_devices)"
|
||||||
|
Reference in New Issue
Block a user