about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2005-07-12 12:30:19 +0000
committerClint Adams <clint@users.sourceforge.net>2005-07-12 12:30:19 +0000
commitafec3b2b5f57d101cdb0ff113a2eec88191f687a (patch)
treed3fa721b0a3fff4c249b33743f661f3d6a4faae2
parent5af2ab3b9cbf701555b58641d251b24ac253de6a (diff)
downloadzsh-afec3b2b5f57d101cdb0ff113a2eec88191f687a.tar.gz
zsh-afec3b2b5f57d101cdb0ff113a2eec88191f687a.tar.xz
zsh-afec3b2b5f57d101cdb0ff113a2eec88191f687a.zip
21447: completion for rubber, contributed by Emmanuel Hainry and Emmanuel Beffara.
-rw-r--r--ChangeLog6
-rw-r--r--Completion/Unix/Command/_rubber70
2 files changed, 76 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d6c82887e..486e2b6ba 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-07-12  Clint Adams  <clint@zsh.org>
+
+	* 21447: Completion/Unix/Command/_rubber: completion for
+	rubber, contributed by Emmanuel Hainry and Emmanuel
+	Beffara.
+
 2005-07-11  Doug Kearns  <djkea2@gus.gscit.monash.edu.au>
 
 	* 21443: Completion/Unix/Command/_rake: new completion for rake
diff --git a/Completion/Unix/Command/_rubber b/Completion/Unix/Command/_rubber
new file mode 100644
index 000000000..cf7199fde
--- /dev/null
+++ b/Completion/Unix/Command/_rubber
@@ -0,0 +1,70 @@
+#compdef rubber rubber-pipe rubber-info
+
+local _rubber_version _rubber_path _rubber_modules
+
+eval $(rubber --version | sed 's/^.* \([^ ]*\): */_rubber_\1=/')
+if [[ ${_rubber_version#0} != $_rubber_version ]]; then
+  _rubber_modules=(
+    $(ls $_rubber_path/rubber/modules | sed -n 's/^\([^_].*\)\.py$/\1/p')
+  )
+else
+  _rubber_modules=(
+    $(ls $_rubber_path/modules | sed -n 's/.rub$//p')
+    $(ls $_rubber_path/rubber/rules/latex | sed -n 's/^\([^_].*\)\.py$/\1/p')
+  )
+fi
+
+_rubber_arguments () {
+    _arguments -s \
+      \*{-c,--command}'=[run the directive CMD before parsing]:command' \
+      \*{-e,--epilogue}'=[run the directive CMD after parsing]:command' \
+      {-z,--gzip}'[compress the final document]' \
+      '(- *)'{-h,--help}'[show help]' \
+      '--into=[go to directory DIR before compiling]:directory:_files -/' \
+      {-l,--landscape}'[change paper orientation (if relevant)]' \
+      {-n,--maxerr}'=[display at most NUM errors]:num' \
+      \*{-m,--module}'=[use module]:module:($_rubber_modules)' \
+      '--only=[only include the specified SOURCES]:sources' \
+      \*{-o,--post}'=[postprocess with module]:postprocessor:($_rubber_modules)' \
+      {-d,--pdf}'[produce PDF output instead of DVI]' \
+      {-p,--ps}'[produce a PostScript document]' \
+      {-q,--quiet}'[suppress messages]' \
+      \*{-r,--read}'[read additional directives from a file]:directives files:_files' \
+      {-s,--short}'[display errors in a compact form]' \
+      \*{-I,--texpath}'=[add DIR to the search path for LaTeX]:tex path:_files -/' \
+      \*{-v,--verbose}'[increase verbosity]' \
+      '--version[print version information and exit]' "$@"
+}
+
+case "$service" in
+  rubber)
+    _rubber_arguments \
+      '--clean[remove produced files instead of compiling]' \
+      {-f,--force}'[force at least one compilation]' \
+      '--inplace[compile the documents from their source directory]' \
+      \*{-W,--warn}'=[report warnings of the given TYPE]:warnings:(all boxes misc refs)' \
+      '*:LaTeX files:_files -g \*.\(tex\|dtx\|lhs\|w\)'
+      return 0
+	;;
+	
+  rubber-pipe)
+    _rubber_arguments \
+      {-k,--keep}'[keep the temporary files after compiling]' \
+      \*{-W,--warn}'=[report warnings of the given TYPE]:warnings:(all boxes misc refs)'
+      return 0
+	;;
+	
+  rubber-info)
+    _rubber_arguments \
+      '--boxes[report overfull and underfull boxes]' \
+      '--check[report errors or warnings default action]' \
+      '--deps[show the target file s dependencies]' \
+      '--errors[show all errors that occured during compilation]' \
+      '--refs[show the list of undefined references]' \
+      '--warnings[show all LaTeX warnings]' \
+      ':LaTeX file:_files -g \*.\(tex\|dtx\|lhs\|w\)'
+      return 0
+  ;;
+esac
+
+return 1