cli: fix bash completion to show general options

This fixes an error in the following example:
  $ nmcli con add type bridge con-name test-bridge <TAB>

Before, general options such as 'autoconnect' and 'ifname' were
wrongly not suggested.

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller
2013-10-03 16:03:07 +02:00
parent f4557256ea
commit 78a8df37d8

View File

@@ -732,9 +732,9 @@ _nmcli()
# means, we are at the end of options. Nothing more to parse, just show # means, we are at the end of options. Nothing more to parse, just show
# what are the options now. # what are the options now.
if [[ "${#OPTIONS_MANDATORY[@]}" -gt 0 ]]; then if [[ "${#OPTIONS_MANDATORY[@]}" -gt 0 ]]; then
_nmcli_list "$(echo "${OPTIONS_TYPED[@]}")" _nmcli_list "$(echo "${OPTIONS[@]}")"
else else
_nmcli_list "$(echo "${OPTIONS_TYPED[@]}") $(echo "${OPTIONS_IP[@]}")" _nmcli_list "$(echo "${OPTIONS[@]}") $(echo "${OPTIONS_IP[@]}")"
fi fi
return 0 return 0
fi fi