summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--Completion/Unix/Command/.distfiles6
-rw-r--r--Completion/Unix/Command/_sablotron52
3 files changed, 57 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 68c360837..52f7c5672 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2003-07-23  Oliver Kiddle  <opk@zsh.org>
 
+	* 18890: Completion/Unix/Command/_sablotron: new sabcmd completion
+
 	* 18877: Etc/completion-style-guide: add a few more points
 
 2003-07-23  Peter Stephenson  <pws@csr.com>
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