summaryrefslogtreecommitdiff
path: root/etc/bash_completion.d/20vyatta-cfg
diff options
context:
space:
mode:
Diffstat (limited to 'etc/bash_completion.d/20vyatta-cfg')
-rwxr-xr-xetc/bash_completion.d/20vyatta-cfg8
1 files changed, 8 insertions, 0 deletions
diff --git a/etc/bash_completion.d/20vyatta-cfg b/etc/bash_completion.d/20vyatta-cfg
index 62a5440..03f0bb2 100755
--- a/etc/bash_completion.d/20vyatta-cfg
+++ b/etc/bash_completion.d/20vyatta-cfg
@@ -643,6 +643,7 @@ vyatta_parse_tmpl ()
# $1: tmpl
vyatta_cfg_help=""
vyatta_cfg_type=""
+ vyatta_cfg_enum=''
vyatta_cfg_tag=0
vyatta_cfg_multi=0
vyatta_cfg_allowed=()
@@ -659,11 +660,18 @@ vyatta_parse_tmpl ()
s/^tag:.*/vyatta_cfg_tag=1/p
s/^multi:.*/vyatta_cfg_multi=1/p
s/^type:[ ]\+\([^ ;]\+\)\(;.*\)\?/vyatta_cfg_type=\1/p
+ s/^enumeration:[ ]\+\([^ ]\+\)/vyatta_cfg_enum=\1/p
' $1`
vyatta_cfg_help=$(vyatta_parse_tmpl_comp_fields $1 "help")
local acmd=$(vyatta_parse_tmpl_comp_fields $1 "allowed")
+ if [ -n "$vyatta_cfg_enum" ]; then
+ local enum_script="/opt/vyatta/share/enumeration/$vyatta_cfg_enum"
+ if [ -f "$enum_script" ] && [ -e "$enum_script" ]; then
+ acmd="$enum_script"
+ fi
+ fi
vyatta_cfg_comp_help=$(vyatta_parse_tmpl_comp_fields $1 "comp_help")
if (( ${#vyatta_cfg_allowed[@]} == 0 )); then