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

PATCH: _growisofs -Z/-M



One regression from my original incomplete version is that -Z and -M
take devicename=filename pairs, which I assumed was covered by the
_mkisofs_pathspec function, even though that is obviously not the case.
I've incorporated the glob from Nikolai's version this time around.

Also, what's going on with the /dev/pts/7 and /dev/pts/8 stuff?

Index: Completion/Unix/Command/_growisofs
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_growisofs,v
retrieving revision 1.2
diff -u -r1.2 _growisofs
--- Completion/Unix/Command/_growisofs	9 Aug 2007 03:03:07 -0000	1.2
+++ Completion/Unix/Command/_growisofs	18 Aug 2007 04:12:10 -0000
@@ -1,5 +1,8 @@
 #compdef mkisofs growisofs
 
+local context state line
+typeset -A opt_args
+
 declare -a find_options
 
 find_options=(
@@ -181,8 +184,8 @@
 
   if [[ $service == growisofs ]]; then
     growisofs_options=(
-      '-Z[burn an initial session to the selected device]:device:_files -g "*(%,@)"'
-      '-M[merge a session with an existing one on the selected device]:device:_files -g "*(%,@)"'
+      '-Z[burn an initial session to the selected device]:device:->devimg'
+      '-M[merge a session with an existing one on the selected device]:device:->devimg'
       '-dvd-compat[provide maximum compatibility with DVD-ROM/Video]'
       '-dry-run[do everything up to the actual burning process]'
       '-overburn[allow overburning of the media]'
@@ -328,5 +331,15 @@
     '(- *)-help[display help message]' \
     '(- *)-version[display version information]' \
     $growisofs_options \
-    '*:pathspec:_mkisofs_pathspec'
+    '*:pathspec:_mkisofs_pathspec' && return 0
+
+    case "$state" in
+      (devimg)
+      if compset -P \*=; then
+        _files
+      else
+        _files -g "*(%,@)"
+      fi
+      ;;
+      esac
 fi



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