cli: option autocompletion should not match words without trailing '-'
This would fix for example: nmcli e <TAB> (e interpreted as --escape, would allow autocompletion to work... but when the command is executed an error is reported) Moreover, we will now have: nmcli c <TAB> autocompletion work correctly, i.e., c is correctly interpreted as "connection" instead of "--colors"
This commit is contained in:
@@ -123,6 +123,8 @@ _nmcli_compl_match_option()
|
|||||||
S="${S:2}"
|
S="${S:2}"
|
||||||
elif [[ "${S:0:1}" == "-" ]]; then
|
elif [[ "${S:0:1}" == "-" ]]; then
|
||||||
S="${S:1}"
|
S="${S:1}"
|
||||||
|
else
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
for V; do
|
for V; do
|
||||||
case "$V" in
|
case "$V" in
|
||||||
|
Reference in New Issue
Block a user