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

Re: Bug#390298: zsh-beta: make-kpkg completion: Support paths for --added-modules



> according the manpage of make-kpkg it is allowed to supply a path to
> --added-modules. Can you change the completion system that it accepts
> paths.
> 
> Because these paths must be absolute, it would be nice if a relative path
> becomes an absolute path automaticly. E.g. --added-modules ../mo<TAB> -->
> --added-modules $PWD/../mol/

This doesn't handle your absolute path requirement; I'm not sure how to
do that sanely.

Index: Completion/Debian/Command/_make-kpkg
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Debian/Command/_make-kpkg,v
retrieving revision 1.4
diff -u -r1.4 _make-kpkg
--- Completion/Debian/Command/_make-kpkg	14 Feb 2007 18:27:52 -0000	1.4
+++ Completion/Debian/Command/_make-kpkg	22 Feb 2007 16:45:33 -0000
@@ -1,10 +1,13 @@
 #compdef make-kpkg
 
+local context state line
+typeset -A opt_args
+
 _arguments \
    '--help[display help message]' \
    '--revision[change Debian revision number]:number:' \
    '--append-to-version[specify additional kernel sub-version]:suffix:' \
-   '--added-modules[specify add-on modules]:module list:' \
+   '--added-modules[specify add-on modules]:module list:->addedmodules' \
    '--added-patches[specify additional patches]:patches list' \
    '--arch[specify architecture for cross-compilation]:architecture' \
    '--cross-compile[specify target string]:target' \
@@ -42,4 +45,13 @@
         configure\:"configure the kernel" \
         debian\:"creates the debian/ directory" \
         libc-kheaders\:"create the kernel headers package needed by libc" \
-        ))'
+        ))' && return 0
+
+case "$state" in
+  (addedmodules)
+    compset -P '*,'
+    _alternative \
+      'moddirs:module dirs:_files -/ -S ,' \
+      'modules:loc module dirs:_files -/ -W ${MODULE_LOC:-/usr/src/modules} -S ,'
+  ;;
+esac



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