diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-01-24 17:34:30 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-01-24 17:34:30 -0800 |
commit | 72c4913ad51c64f73f49e6ec00764185b8c32740 (patch) | |
tree | b9e92b23778e2a08f769d8a46c4c8dd5015e1ed1 /etc/bash_completion.d | |
parent | c0f8c1cbd9afc87ae76222024dd0e98127ca1708 (diff) | |
download | vyatta-cfg-72c4913ad51c64f73f49e6ec00764185b8c32740.tar.gz vyatta-cfg-72c4913ad51c64f73f49e6ec00764185b8c32740.zip |
add "official" support for "comp_help" and "allowed" in config template
parser (ignored by backend).
Diffstat (limited to 'etc/bash_completion.d')
-rw-r--r-- | etc/bash_completion.d/20vyatta-cfg | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg index bc9088f..c8e4908 100644 --- a/etc/bash_completion.d/20vyatta-cfg +++ b/etc/bash_completion.d/20vyatta-cfg @@ -354,14 +354,13 @@ vyatta_parse_tmpl_comp_fields () # $1: tmpl # $2: field name sed -n ' - /^#'"$2"':/,$ { - s/^#'"$2"':// + /^'"$2"':/,$ { + s/^'"$2"':// h :b $ { x; p; q } n - /^#[-_a-z]\+:/ { x; p; q } - s/^#// + /^[-_a-z]\+:/ { x; p; q } H bb } @@ -387,12 +386,8 @@ vyatta_parse_tmpl () return fi eval `sed -n ' - /^help:[ ]\+/,/^[a-z]\+:/ { - s/^help:[ ]\+/vyatta_cfg_help=/p - /^ /p - } - /^syntax:[ ]\+\$(@)[ ]\+in[ ]\+/ { - s/^syntax:[ ]\+\$(@)[ ]\+in[ ]\+/vyatta_cfg_allowed=( / + /^syntax:expression:[ ]\+\$(@)[ ]\+in[ ]\+/ { + s/^syntax:expression:[ ]\+\$(@)[ ]\+in[ ]\+/vyatta_cfg_allowed=( / s/^\([^;]\+\);.*$/\1 )/ s/[ ]*,[ ]*/ /gp } @@ -401,6 +396,8 @@ vyatta_parse_tmpl () s/^type:[ ]\+\([^ ;]\+\)\(;.*\)\?/vyatta_cfg_type=\1/p ' $1` + vyatta_cfg_help=$(vyatta_parse_tmpl_comp_fields $1 "help") + local acmd=$(vyatta_parse_tmpl_comp_fields $1 "allowed") vyatta_cfg_comp_help=$(vyatta_parse_tmpl_comp_fields $1 "comp_help") |