diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-03-12 15:03:11 -0700 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-03-12 15:03:11 -0700 |
commit | 58dac8aa8edab4f904c9a621ad20c016f2b7bda5 (patch) | |
tree | e66d94ec49ad0fb0f32a5ff2ff7ce30f46efc0ef /etc/bash_completion.d | |
parent | ee9178c72e1fff0eff2932297f039eb0345f26b1 (diff) | |
download | vyatta-cfg-58dac8aa8edab4f904c9a621ad20c016f2b7bda5.tar.gz vyatta-cfg-58dac8aa8edab4f904c9a621ad20c016f2b7bda5.zip |
handle "<*>" allowed values
Diffstat (limited to 'etc/bash_completion.d')
-rwxr-xr-x | etc/bash_completion.d/20vyatta-cfg | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index 463b383..4ad86ce 100755 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -440,8 +440,14 @@ 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 )" + local -a ares=( $(eval "$acmd") ) + 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>' |