+ local dbg_cmds=( "none info init key gui \
+ parser lyxrc kbmap latex mathed font tclass \
+ lyxvc lyxserver roff action lyxlex depend insets \
+ files workarea insettext graphics changes \
+ external painting debug any" )
+
+ #echo "cmds: '$dbg_cmds'"
+
+ if [[ $COMP_CWORD > 1 ]]; then
+ last=${COMP_WORDS[$(($COMP_CWORD - 1))]}
+ else
+ last=''
+ fi
+
+ case "$last" in
+ +\(--export|-e\))
+ _filedir '+(pdf[1234]|PDF[1234]|pdf|PDF|ps|PS|xhtml|XHTML)';;
+ -dbg)
+ # check for multiple debug commands
+ if [[ $cur == *,* ]]; then #
+ COMPREPLY=( $( compgen -W '$dbg_cmds' \
+ -P ${cur%,*}, -- ${cur##*,} ) )
+ else
+ COMPREPLY=( $( compgen -W '$dbg_cmds' -- $cur ) )
+ fi;;
+ *)
+ case "$cur" in
+ -*)
+ # LyX command line options