mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-03 12:50:17 +01:00
merge: branch 'ih/nmcli-complete'
nmcli: fix argument completion if nmcli is aliased Closes #1734 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/2159
This commit is contained in:
commit
45e7e158c1
1 changed files with 4 additions and 1 deletions
|
|
@ -49,7 +49,10 @@ _nmcli()
|
|||
cur=''
|
||||
fi
|
||||
|
||||
output="$(nmcli --complete-args "${words[@]}" 2>/dev/null)"
|
||||
# If the user set an alias like `nmcli=nmcli --some-arguments`, then --complete-args
|
||||
# might give unexpected behaviours. Use `command` to ensure that aliases are ignored
|
||||
# and the nmcli binary is used directly.
|
||||
output="$(command nmcli --complete-args "${words[@]}" 2>/dev/null)"
|
||||
|
||||
# Bail out early if we're completing a file name
|
||||
if [ $? = 65 ]; then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue