about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--Completion/Debian/Command/_module-assistant37
-rw-r--r--Completion/Unix/Command/_baz4
-rw-r--r--Completion/Unix/Command/_tla4
4 files changed, 54 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 9883dbeb1..c6f2f83e0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-04-17  Clint Adams  <clint@zsh.org>
+
+        * 21153: Completion/Debian/Command/_module-assistant: incorporate
+        most of the features of Stephen Rueger's _module-assistant, posted
+        as 21152.
+
+        * 21151: Completion/Debian/Command/_module-assistant: completion
+        for module-assistant.
+
+        * 21150: Completion/Unix/Command/_baz,
+        Completion/Unix/Command/_tla: handle parsing of subcommand help
+        output a bit more sanely.
+
 2005-04-16  Clint Adams  <clint@zsh.org>
 
         * 21147: Completion/Unix/Command/_baz,
diff --git a/Completion/Debian/Command/_module-assistant b/Completion/Debian/Command/_module-assistant
new file mode 100644
index 000000000..11c587b3f
--- /dev/null
+++ b/Completion/Debian/Command/_module-assistant
@@ -0,0 +1,37 @@
+#compdef module-assistant m-a
+
+typeset -a _module_assistant_commands
+
+_module_assistant_commands=(
+    "update[synchronize version index files]"
+    "prepare[install required kernel headers package]"
+    "fakesource[install required kernel source package]"
+    "list[a print a list of details about available packages]"
+    "list-available[b print a list of details about available packages ]"
+    "la[c print a list of details about available packages  ]"
+    "list-installed[ print a list of details about installed packages ]"
+    "li[print a list of details about installed packages  ]"
+    "search[search for packages]"
+    "get[install specified source package]"
+    "build[build specified packages]"
+    "install[install specified packages]"
+    "auto-install[do all necessary steps to install specified packages]"
+    "clean[clear build directories of the kernel packages]"
+    "purge[clear cache and remove all binary packages of source package]"
+)
+
+_arguments -A \
+ '(-h --help)'{-h,--help}'[print help screen]' \
+ '(-v --verbose)'{-v,--verbose}'[Be verbose, show full paths, etc.]' \
+ '(-q --quiet)'{-q,--quiet}'[The opposite of verbose]' \
+ '(-n --no-rebuild)'{-n,--no-rebuild}'[Do not rebuild when package exists]' \
+ '(-i --ignore-failures)'{-i,--ignore-failures}'[Do not stop on build failures]' \
+ '(-s --apt-search)'{-s,--apt-search}'[Search for installation candidates in the Debian archive]' \
+ '(-f --force)'{-f,--force}'[Force using new versions even when old ones exist]' \
+ '(-u --userdir)'{-u,--userdir}'[Specify a (writable) replacement directory for /var&/usr]:dir:_files -/' \
+ '(-l --kvers-list)'{-l,--kvers-list}'[List of kernel versions to work on (default: current version)]:kernel version list:' \
+ '(-k --kernel-dir)'{-k,--kernel-dir}'[List of kernel headers/source directories, comma separated]:list of dirs:_files -/' \
+ '(-t --text-mode)'{-t,--text-mode}'[no progress bars]' \
+ '1:list of commands:_values -s , subcommands "${_module_assistant_commands[@]}"' \
+ '*:packages: compadd /usr/src/modass/var_cache_modass/*.avail_version(N:t:r) /var/cache/modass/*.avail_version(N:t:r)'
+
diff --git a/Completion/Unix/Command/_baz b/Completion/Unix/Command/_baz
index c5a65437a..a15596488 100644
--- a/Completion/Unix/Command/_baz
+++ b/Completion/Unix/Command/_baz
@@ -490,8 +490,7 @@ _baz_main () {
 
     arguments=()
     local input
-    input=(${${(f)"$($BAZ $cmd -h)"}#  })
-    shift 6 input
+    input=(${${(M)${(f)"$($BAZ $cmd -h)"}:#  *}#  })
 
     local i j=1
     local short long arg desc action
@@ -513,6 +512,7 @@ _baz_main () {
         (( i++ ))
         desc[j]="$desc[j] ${input[i]##*  }"
       fi
+      [[ "$short[j]" == -[hHV] ]] && continue
       desc[j]="${${desc[j]//\[/\\[}//\]/\\]}" # escape brackets
 
       case $arg[j] in
diff --git a/Completion/Unix/Command/_tla b/Completion/Unix/Command/_tla
index 876f9dcf3..a047d1dd1 100644
--- a/Completion/Unix/Command/_tla
+++ b/Completion/Unix/Command/_tla
@@ -527,8 +527,7 @@ _tla_main () {
 
     arguments=()
     local input
-    input=(${${(f)"$($TLA $cmd -h)"}#  })
-    shift 6 input
+    input=(${${(M)${(f)"$($TLA $cmd -h)"}:#  *}#  })
 
     local i j=1
     local short long arg desc action
@@ -550,6 +549,7 @@ _tla_main () {
         (( i++ ))
         desc[j]="$desc[j] ${input[i]##*  }"
       fi
+      [[ "$short[j]" == -[hHV] ]] && continue
       desc[j]="${${desc[j]//\[/\\[}//\]/\\]}" # escape brackets
 
       case $arg[j] in