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

Re: PATCH: New completions



In article <4FBF540FF16FD1119D9600A0C94B2B51F29E90@xxxxxxxxxxxxxxxxxxx>,
  "Kiddle, Oliver" <KiddleO@xxxxxxxxxx> writes:

> + #compdef chown chgrp

This uses "." as a separator between owner and group for chown.
But SunOS 5.x uses ":" instead of ".".

--- Completion/User/_chown-	Fri Jun 18 20:55:51 1999
+++ Completion/User/_chown	Fri Jun 18 20:54:45 1999
@@ -1,10 +1,13 @@
 #compdef chown chgrp
 
 if [[ CURRENT -eq 2 || CURRENT -eq 3 && $words[CURRENT-1] = -* ]]; then
-  if [[ $words[1] = chgrp ]] || compset -P '*.'; then
+  if [[ $words[1] = chgrp ]] || compset -P '*[:.]'; then
     _groups
   else
-    compgen -u -S '.' -q
+    case $OSTYPE in
+      solaris*) compgen -u -S ':' -q;;
+      *) compgen -u -S '.' -q;;
+    esac
   fi
 else
   _files

Hm. FreeBSD supports "." in addition to ":" even though chown(8)
doesn't explain.
-- 
Tanaka Akira



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