summary refs log tree commit diff
path: root/src/nmcli/nmcli-completion
diff options
context:
space:
mode:
Diffstat (limited to 'src/nmcli/nmcli-completion')
-rw-r--r--src/nmcli/nmcli-completion5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nmcli/nmcli-completion b/src/nmcli/nmcli-completion
index f2de7b67..0c9b5156 100644
--- a/src/nmcli/nmcli-completion
+++ b/src/nmcli/nmcli-completion
@@ -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