mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 20:38:10 +02:00
nmcli/bash-completion: complete [+-] modifier for connection modify property
Fixes nmcli connection modify CONNECTION +conn<TAB>
This commit is contained in:
parent
f6fba86984
commit
c3246d962d
1 changed files with 6 additions and 1 deletions
|
|
@ -1154,7 +1154,12 @@ _nmcli()
|
||||||
_nmcli_compl_ARGS_CONNECTION && return 0
|
_nmcli_compl_ARGS_CONNECTION && return 0
|
||||||
while [[ "${#words[@]}" -gt 0 ]]; do
|
while [[ "${#words[@]}" -gt 0 ]]; do
|
||||||
if [[ ${#words[@]} -le 1 ]]; then
|
if [[ ${#words[@]} -le 1 ]]; then
|
||||||
_nmcli_list_nl "$(nmcli --fields profile connection show "${COMMAND_CONNECTION_TYPE:-id}" "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/\1/p')"
|
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:-id}" "$COMMAND_CONNECTION_ID" 2>/dev/null | sed -n 's/^\([^:]\+\):.*/'$PREFIX'\1/p')"
|
||||||
return 0
|
return 0
|
||||||
elif [[ ${#words[@]} -le 2 ]]; then
|
elif [[ ${#words[@]} -le 2 ]]; then
|
||||||
return 0
|
return 0
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue