summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d/20vyatta-cfg
diff options
context:
space:
mode:
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-rw-r--r--etc/bash_completion.d/20vyatta-cfg17
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")