diff options
author | rbalocca <rbalocca@vyatta.com> | 2008-04-24 13:33:46 -0700 |
---|---|---|
committer | rbalocca <rbalocca@vyatta.com> | 2008-04-24 13:33:46 -0700 |
commit | a309f120a9ff472d45544a9101226334e426e76a (patch) | |
tree | bfdb25a51f42443587668e8fd5ba0597b0d744d9 /etc/bash_completion.d/20vyatta-cfg | |
parent | c29e34d11a22eecbaa50fa134965f2fa036f47f3 (diff) | |
parent | 7fd560b72df1b327b4b47a6232dfcf16d6fae52c (diff) | |
download | vyatta-cfg-a309f120a9ff472d45544a9101226334e426e76a.tar.gz vyatta-cfg-a309f120a9ff472d45544a9101226334e426e76a.zip |
Merge branch 'glendale'
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-rwxr-xr-x[-rw-r--r--] | etc/bash_completion.d/20vyatta-cfg | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 5966e18..f979939 100644..100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -1,22 +1,23 @@ +#!/bin/sh + # **** License **** -# Version: VPL 1.0 -# -# The contents of this file are subject to the Vyatta Public License -# Version 1.0 ("License"); you may not use this file except in -# compliance with the License. You may obtain a copy of the License at -# http://www.vyatta.com/vpl -# -# Software distributed under the License is distributed on an "AS IS" -# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -# the License for the specific language governing rights and limitations -# under the License. +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation. # -# This code was originally developed by Vyatta, Inc. -# Portions created by Vyatta are Copyright (C) 2006, 2007 Vyatta, Inc. -# All Rights Reserved. +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# A copy of the GNU General Public License is available as +# `/usr/share/common-licenses/GPL' in the Debian GNU/Linux distribution +# or on the World Wide Web at `http://www.gnu.org/copyleft/gpl.html'. +# You can also obtain it by writing to the Free Software Foundation, +# Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, +# MA 02110-1301, USA. # # Author: An-Cheng Huang -# Date: 2007 # Description: bash completion for Vyatta configuration commands # # **** End License **** @@ -439,8 +440,17 @@ vyatta_parse_tmpl () vyatta_cfg_comp_help=$(vyatta_parse_tmpl_comp_fields $1 "comp_help") if (( ${#vyatta_cfg_allowed[@]} == 0 )); then - local ares=$(eval "$acmd") - eval "vyatta_cfg_allowed=( $ares )" + astr=$(eval "$acmd") + astr=${astr//</\\<} + astr=${astr//>/\\>} + eval "ares=( $astr )" + for (( i=0 ; i<${#ares[@]} ; i++ )); do + if [[ "${ares[i]}" != \<*\> ]]; then + vyatta_cfg_allowed+=( "${ares[i]}" ) + else + vyatta_cfg_allowed+=( "" ) + fi + done fi if [ -z "$vyatta_cfg_help" ]; then vyatta_cfg_help='<No help text available>' |