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

[PATCH] _mkdir: support macOS and builtin mkdir



mkdir is another command which macOS borrows from FreeBSD.
I'm sending a patch in a separate post because it has another problem:

_mkdir does not work correctly for builtin mkdir (from zsh/files module):

% zmodload zsh/files
% mkdir -<TAB>
this will list long options (--mode and --parents) in addition to -m and -p.

Simple fix is in the patch below; is this OK?


diff --git a/Completion/Unix/Command/_mkdir b/Completion/Unix/Command/_mkdir
index 53536b01d..e4308c304 100644
--- a/Completion/Unix/Command/_mkdir
+++ b/Completion/Unix/Command/_mkdir
@@ -26,7 +26,7 @@ fi
 # Now $variant is set.
 
 case $variant in
-  gnu|freebsd*|dragonfly*)
+  gnu|freebsd*|dragonfly*|darwin*)
     args+=(
       '(-v --verbose)'{-v,--verbose}'[print message for each created directory]'
     )
@@ -42,8 +42,6 @@ case $variant in
       '(- :)--version[display version information]'
     )
   ;;
-  zsh) # remove all options
-  ;;
   *) # non-GNU: remove long options
     args=( ${${${args:#(|*\))--*}//--[^ )]#/}/\( #\)/} )
   ;;




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