# PBLaTeX Bash Completion # # $Id: pblatex.bc,v 1.2 2004/06/17 19:39:27 hendrik Exp $ # pblatexHome=/usr/share/pblatex/ _pblatex() { # local variable local cur COMPREPLY=() cur=${COMP_WORDS[COMP_CWORD]} prev=${COMP_WORDS[COMP_CWORD-1]} mode='' if [ $COMP_CWORD -eq 1 ]; then COMPREPLY=( $( compgen -W '--help --version --copyright \ admin backup clean compile \ output plugin project release \ set status update view \ ' -- $cur ) ) return 0 fi case ${COMP_WORDS[1]} in admin) COMPREPLY=( $( compgen -W '-u --create-user-settings' -- $cur ) ) ;; project) COMPREPLY=( $( compgen -W 'new create config reconfig export cvs upgrade \ --create-prj-file --update-hyperref --update-userprofile \ ' -- $cur ) ) ;; compile) COMPREPLY=( $( compgen -W '-q --quit -c --clean -v --view -qvc' -- $cur ) ) ;; output) COMPREPLY=( $( compgen -W '-d --dvi -s -ps --postscript -p -pdf --pdf \ -w -web --html' -- $cur ) ) ;; update) COMPREPLY=( $( compgen -W 'appendix parts' -- $cur ) ) mode='append-lang' ;; set) COMPREPLY=( $( compgen -W '-r -rn --releasename \ -c -cm --compile-method \ ' -- $cur ) ) ;; plugin) plugins=`/bin/ls -1 $pblatexHome/plugins/` plugins="$plugins `/bin/ls -1 $HOME/.pblatex/plugins/`" COMPREPLY=( $( compgen -W "$plugins" -- $cur ) ) ;; *) ;; esac case ${COMP_WORDS[2]} in new|create) templates=`/bin/ls -1 $pblatexHome/templates/` templates="$templates `/bin/ls -1 $HOME/.pblatex/templates/`" COMPREPLY=( $( compgen -W "$templates" -- $cur ) ) ;; export) COMPREPLY=( $( compgen -W '-v -z --gzip -j --bzip2 -f --file' -- $cur ) ) ;; appendix|parts) COMPREPLY=( $( compgen -W 'de en fr' -- $cur ) ) ;; en|enable|dis|disable) COMPREPLY=( $( compgen -W 'bibtex minlex index parts appendix' -- $cur ) ) ;; -d|--dvi|-s|-ps|--postscript|-p|-pdf|--pdf|-w|-web|--html) if [ "x${COMP_WORDS[1]}" = "xoutput" ]; then COMPREPLY=( $( compgen -W '-c --recompile -f --target-file --force' -- $cur ) ) fi ;; -c|-cm|--compile-method) if [ "x${COMP_WORDS[1]}" = "xset" ]; then COMPREPLY=( $( compgen -W 'normal fast' -- $cur ) ) fi ;; esac return 0 } complete -F _pblatex pblatex