From fdecb6b6691e176bbc1bcce3ccac6f08d800ed59 Mon Sep 17 00:00:00 2001 From: Francesco Giudici Date: Tue, 28 Jun 2016 12:12:39 +0200 Subject: [PATCH] cli: option autocompletion should not match words without trailing '-' This would fix for example: nmcli e (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 autocompletion work correctly, i.e., c is correctly interpreted as "connection" instead of "--colors" --- clients/cli/nmcli-completion | 2 ++ 1 file changed, 2 insertions(+) diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion index 374f0fae4..bb47f2d6a 100644 --- a/clients/cli/nmcli-completion +++ b/clients/cli/nmcli-completion @@ -123,6 +123,8 @@ _nmcli_compl_match_option() S="${S:2}" elif [[ "${S:0:1}" == "-" ]]; then S="${S:1}" + else + return 1 fi for V; do case "$V" in