From d0fbb688f563a6919ce68d39eb55768cefa6bc65 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 23 Feb 2015 17:51:04 +0100 Subject: [PATCH] cli/completion: add completion for --colors option https://bugzilla.gnome.org/show_bug.cgi?id=738613 Fixes: 758e488f13140e55581c756ebab5ed7edb716f65 --- clients/cli/nmcli-completion | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/clients/cli/nmcli-completion b/clients/cli/nmcli-completion index dce20d138..8443844f9 100644 --- a/clients/cli/nmcli-completion +++ b/clients/cli/nmcli-completion @@ -197,6 +197,13 @@ _nmcli_compl_OPTIONS() fi _nmcli_array_delete_at words 0 1 ;; + colors) + if [[ "${#words[@]}" -eq 2 ]]; then + _nmcli_list "yes no auto" + return 0 + fi + _nmcli_array_delete_at words 0 1 + ;; fields) if [[ "${#words[@]}" -eq 2 ]]; then _nmcli_list "all common @@ -683,7 +690,7 @@ _nmcli() local COMMAND_CONNECTION_ACTIVE="" HELP_ONLY_AS_FIRST= - local LONG_OPTIONS=(terse pretty mode fields escape nocheck ask wait version help) + local LONG_OPTIONS=(terse pretty mode fields colors escape nocheck ask wait version help) _nmcli_compl_OPTIONS i=$?