Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: updated _debchange



Hi,
I made a _debchange completion that supports more command line options 
than current one

arno.


Index: Completion/Debian/Command/_debchange
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_debchange,v
retrieving revision 1.2
diff -u -r1.2 _debchange
--- Completion/Debian/Command/_debchange	31 Jul 2003 15:26:14 -0000	1.2
+++ Completion/Debian/Command/_debchange	23 Jan 2007 18:57:06 -0000
@@ -1,10 +1,46 @@
 #compdef debchange dch=debchange
 
-_arguments \
-  '(-h --help)'{-h,--help}'[display help information]' \
-  '--version' \
-  '(--append -a --newversion -v --increment -i)'{-i,--increment}'[increment release or version number]' \
-  '(--append -a --newversion -v --increment -i)'{-a,--append}'[add new changelog entry]' \
-  '(--append -a --newversion -v --increment -i)'{-v,--newversion}'[specify new version number]:version:' \
-  '(--preserve -p)'{-p,--preserve}'[preserve source tree directory name]' \
-  ':text:'
+_debchange () {
+    emulate -L zsh
+    setopt extendedglob
+
+    # only 0 or 1 of those options may be proposed
+    local exlusive="--append -a --increment -i --edit -e --release -r --newversion -v --fromdirname -d"
+    
+    local logheuristic="looks for dupload or dput log file"
+    local changelogheuristic="searchs for UNRELEASED in changelog"
+    local distribs="unstable testing stable experimental UNRELEASED testing-security stable-security oldstable-security"
+
+    _arguments \
+    '--create[create new debian/changelog]' \
+    '(--force-bad-version, -b)'{-b,--force-bad-version}'[allows version to be less than current one]' \
+    '(--no-preserve --preserve -p)'{-p,--preserve}'[do preserve source tree directory name]' \
+    '(--no-preserve --preserve -p)--no-preserve[do not preserve source tree directory name]' \
+    '(--query)--noquery[do not contact BTS]' \
+    '(--noquery)--query[do contact BTS]' \
+    '(--multimaint)--nomultimaint[do not introduce multi-maintainer distinctions]' \
+    '(--nomultimaint)--multimaint[do introduce multi-maintainer distinctions]' \
+    "($exlusive)"{-i,--increment}'[increment release or version number]' \
+    "($exlusive)"{-a,--append}'[add new changelog entry]' \
+    "($exlusive)"{-v,--newversion}'[specify new version number]:version:' \
+    "($exlusive)"{-e,--edit}'[update timestamp, and start editor]' \
+    "($exlusive)"{-r,--release}'[update timestamp. Possibly set distribution]' \
+    '(--closes --news)--closes[add entries to close bugs]:bugs closed:' \
+    '(--changelog -c --closes -news)--news[edit newsfile]' \
+    '(--changelog -c --news)'{-c,--changelog}'[edit changelog]:changelog file:_files' \
+    '--release-heuristic[method to determine package release]:heuristic:((changelog\:$changelogheuristic log\:$logheuristic))' \
+    '--check-dirname-level[how to check directory]:level:((0\:never 1\:default 2\:always))' \
+    '--check-dirname-regex[regex for directory matching]:regexp:' \
+    '--package[package name]:name:' \
+    "($exlusive)"{-d,--fromdirname}'[get version from directory name]' \
+    '(--distribution -D)'{--distribution,-D}"[use specified distribution]:distribution:($distribs)" \
+    '(--urgency -u)'{--urgency,-u}'[specify urgency]:urgency:(low medium high critical emergency)' \
+    '(--maintmaint -m)'{--maintmaint,-m}'[do not modify maintainer in changelog]' \
+    '(--no-conf --noconf)'{--no-conf,--noconf}'[do not read any configuration files]' \
+    '(-h --help)'{-h,--help}'[display help information]' \
+    '--version[display version and copyright]' \
+    ':text:( )'
+
+}
+
+_debchange "$@"

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author