From 5ad82e8c5a23dbf954f9b17c46a3c82a1c143bd6 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 16 Feb 2011 15:20:44 -0800 Subject: fix for bug 6754 * force all command-line words to be non-options. --- etc/bash_completion.d/vyatta-cfg | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'etc/bash_completion.d') diff --git a/etc/bash_completion.d/vyatta-cfg b/etc/bash_completion.d/vyatta-cfg index 87aaae3..d3cb36d 100755 --- a/etc/bash_completion.d/vyatta-cfg +++ b/etc/bash_completion.d/vyatta-cfg @@ -52,7 +52,7 @@ vyatta_cli_shell_api () shift fi local outstr - if ! outstr=$(${vyatta_sbindir}/my_cli_shell_api "$@"); then + if ! outstr=$(${vyatta_sbindir}/my_cli_shell_api -- "$@"); then # display the error output (if any) and then fail if [ -n "$outstr" ]; then echo "$outstr" @@ -88,15 +88,17 @@ done show () { + local -a opts=() local -a args=() for arg in "$@"; do if [ "$arg" == "-all" ]; then - args+=('--show-show-defaults') + opts+=('--show-show-defaults') else args+=("$arg") fi done - cli-shell-api showCfg "${args[@]}" | eval "${VYATTA_PAGER:-cat}" + cli-shell-api "${opts[@]}" -- showCfg "${args[@]}" \ + | eval "${VYATTA_PAGER:-cat}" } commit () -- cgit v1.2.3