diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-07-23 11:11:39 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-07-23 11:11:39 +0000 |
commit | 5ce1bd325ace5fc3c56e2339111aa2aa8fe73d52 (patch) | |
tree | 63098f45e45d3b53e7131fd6c9592f7581ddc83b /Completion/Unix/Command | |
parent | c3a03617eadd35676dddbf54a73fe88381207cc1 (diff) | |
download | zsh-5ce1bd325ace5fc3c56e2339111aa2aa8fe73d52.tar.gz zsh-5ce1bd325ace5fc3c56e2339111aa2aa8fe73d52.tar.xz zsh-5ce1bd325ace5fc3c56e2339111aa2aa8fe73d52.zip |
18890: new completion for sabcmd
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r-- | Completion/Unix/Command/.distfiles | 6 | ||||
-rw-r--r-- | Completion/Unix/Command/_sablotron | 52 |
2 files changed, 55 insertions, 3 deletions
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles index ba94cf5c5..bf56f8478 100644 --- a/Completion/Unix/Command/.distfiles +++ b/Completion/Unix/Command/.distfiles @@ -13,12 +13,12 @@ _cpio _getconf _lp _pbm _sudo _zdump _cvs _gnu_generic _ls _perl _tar _zip _dd _gprof _lynx _perldoc _telnet _pine _dict _grep _lzop _prcs _tiff _elm -_diff _gs _make _psutils _tin _apm _mail +_diff _gs _make _psutils _tin _mail _last _loadkeys _ruby _sysctl _links _samba _user_admin _rsync _arping _spamassassin _mtools _ifconfig _fsh _chkconfig _cdcd _irssi _mysqldiff _sccs _netcat _larch _texinfo _figlet _elinks _tidy _global _global_tags _ant _lsof _mt _xmlsoft -_perforce _python _antiword _screen _renice -_ecasound _gpg _subversion _aap +_perforce _python _antiword _screen _renice _apm +_ecasound _gpg _subversion _aap _sablotron ' diff --git a/Completion/Unix/Command/_sablotron b/Completion/Unix/Command/_sablotron new file mode 100644 index 000000000..a8d332103 --- /dev/null +++ b/Completion/Unix/Command/_sablotron @@ -0,0 +1,52 @@ +#compdef sabcmd + +local curcontext="$curcontext" state mode line expl ret=1 +typeset -A opt_args +local mopts='(-c -x -s -? -v --chain-xsl --batch-xml --batch-xsl --help --version)' + +_arguments -C \ + '(-b --base)'{-b,--base=}'[specify base URI]:URI' \ + '(-)--debug-options[show help on debug options]' \ + '(- *)'{-\?,--help}'[show help information]' \ + '(-L --log-file)'{-L,--log-file=}'[specify log file, turn on logging]:log file:_files' \ + '(-m --measure)'{-m,--measure}'[measure the processing time]' \ + '(- *)'{-v,--version}'[display version information]' \ + '--debugger[run the xslt debugger]' \ + $mopts{-c,--chain-xsl}'[single input file, multiple chained stylesheets]' \ + $mopts{-x,--batch-xml}'[single input file, multiple stylesheets]' \ + $mopts{-s,--batch-xsl}'[multiple input files, single stylesheet]' \ + '*: :->arguments' && ret=0 + +if [[ -n "$state" ]]; then + mode="${opt_args[(i)-c|--chain-xsl]:+chain}${opt_args[(i)-x|--batch-xml]:+batch-x}${opt_args[(i)-s|--batch-xsl]:+batch-s}" + [[ $mode = (chain|batch-[xs]) ]] || mode=default + _tags assignments files + while _tags; do + if _requested assignments; then + if [[ -prefix *= ]]; then + _message -e value value + else + _message -e parameter 'parameter name' + fi + fi + if _requested files; then + case $mode:${#words[1,CURRENT-1]:#(-*|*=*)}; in + default:1|chain:<3->|batch-x:2|batch-s:1) + _description files expl stylesheet + _files "$expl[@]" -g \*.xsl && ret=0 + ;; + default:2|chain:1|batch-x:1|batch-s:2) + _description files expl 'input file' + _files "$expl[@]" && ret=0 + ;; + default:3|chain:2|batch-x:<3->|batch-s:<3->) + _description files expl 'output file' + _files "$expl[@]" && ret=0 + ;; + esac + fi + (( ret )) || break + done +fi + +return ret |