mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-01 23:30:13 +01:00
nmcli/bash-completion: fix detecting connection for connection modify
Previously we would only complete connections given by ID.
The following would work:
$ nmcli connection modify id <ID> <TAB>
$ nmcli connection modify <ID> <TAB>
$ nmcli connection modify uuid <UUID> <TAB>
but the following would not work:
$ nmcli connection modify <UUID> <TAB>
(cherry picked from commit 5ef233936a)
This commit is contained in:
parent
bcb35eb6ad
commit
4fb85b57b8
1 changed files with 2 additions and 2 deletions
|
|
@ -1159,14 +1159,14 @@ _nmcli()
|
|||
if [[ "${words[0]:0:1}" == [+-] ]]; then
|
||||
PREFIX="${words[0]:0:1}"
|
||||
fi
|
||||
_nmcli_list_nl "$(nmcli --fields profile connection show "${COMMAND_CONNECTION_TYPE:-id}" "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/'$PREFIX'\1/p')"
|
||||
_nmcli_list_nl "$(nmcli --fields profile connection show ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/'$PREFIX'\1/p')"
|
||||
return 0
|
||||
elif [[ ${#words[@]} -le 2 ]]; then
|
||||
return 0
|
||||
fi
|
||||
_nmcli_array_delete_at words 0 1
|
||||
done
|
||||
_nmcli_list_nl "$(nmcli --fields profile connection show "${COMMAND_CONNECTION_TYPE:-id}" "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')"
|
||||
_nmcli_list_nl "$(nmcli --fields profile connection show ${COMMAND_CONNECTION_TYPE} "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')"
|
||||
return 0
|
||||
fi
|
||||
;;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue