From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@sunsite.dk
Subject: PATCH: _ls, _chflags, _file_systems, _comm (2)
Date: Thu, 27 Sep 2007 18:29:04 +0900 [thread overview]
Message-ID: <a06001015c32127d35c0f@kba.biglobe.ne.jp> (raw)
I'm re-posting this just in case my previous one (Sep.12) was lost
by the trouble.
Here are pathces for a few simple completion functions:
_ls, _chflags, _file_systems
Support darwin (MacOSX)
_comm
complete GNU options only if GNU version
I hope they have no problems.
===================================================================
diff -u zsh/Completion/Unix/Command/_ls zsh2/Completion/Unix/Command/_ls
--- zsh/Completion/Unix/Command/_ls 2006-05-25 16:58:07.000000000 +0900
+++ zsh2/Completion/Unix/Command/_ls 2007-09-12 00:09:01.000000000 +0900
@@ -5,7 +5,7 @@
_pick_variant -r is_gnu gnu=gnu unix --help
-if [[ "$OSTYPE" = (netbsd*|freebsd*|openbsd*) && "$is_gnu" != gnu ]]; then
+if [[ "$OSTYPE" = (netbsd*|freebsd*|openbsd*|darwin*) && "$is_gnu" != gnu ]]; then
arguments=(
'(-A)-a[list entries starting with .]'
'(-a)-A[list all except . and ..]'
@@ -54,6 +54,13 @@
'*:files:_files'
)
+ if [[ "$OSTYPE" = (freebsd*|darwin*) ]]; then
+ arguments+=(
+ '-G[enable colorized output]'
+ '-H[follow symlinks on the command line]'
+ '-P[do not follow symlinks]'
+ )
+ fi
else
arguments=(
'(--all -a -A --almost-all)'{--all,-a}'[list entries starting with .]'
===================================================================
diff -u zsh/Completion/BSD/Command/_chflags zsh2/Completion/BSD/Command/_chflags
--- zsh/Completion/BSD/Command/_chflags 2005-05-11 18:27:09.000000000 +0900
+++ zsh2/Completion/BSD/Command/_chflags 2007-09-09 23:39:32.000000000 +0900
@@ -25,7 +25,7 @@
unset own
fi
-if [[ $OSTYPE = (freebsd|dragonfly)* ]]; then
+if [[ $OSTYPE = (freebsd|dragonfly|darwin)* ]]; then
flags=( $flags[@]
'(nouunlnk)uunlnk[set the user undeletable flag]'
'(uunlnk)nouunlnk[unset the user undeletable flag]'
===================================================================
diff -u zsh/Completion/Unix/Type/_file_systems zsh2/Completion/Unix/Type/_file_systems
--- zsh/Completion/Unix/Type/_file_systems 2005-06-08 21:45:35.000000000 +0900
+++ zsh2/Completion/Unix/Type/_file_systems 2007-09-11 23:01:53.000000000 +0900
@@ -20,6 +20,10 @@
fss=( cd9660 devfs ext2fs fdesc kernfs linprocfs mfs msdos nfs
ntfs null nwfs portal procfs std udf ufs umap union )
;;
+ darwin*)
+ fss=( afp cd9660 cddafs devfs fdesc hfs lfs msdos nfs
+ ntfs smbfs synthfs udf ufs volfs webdav )
+ ;;
*)
# default for all other systems
fss=( ufs )
===================================================================
diff -u zsh/Completion/Unix/Command/_comm zsh2/Completion/Unix/Command/_comm
--- zsh/Completion/Unix/Command/_comm 2007-03-12 09:02:11.000000000 +0900
+++ zsh2/Completion/Unix/Command/_comm 2007-09-08 01:04:19.000000000 +0900
@@ -1,10 +1,20 @@
#compdef comm
-_arguments -s \
- '-1[suppress lines unique to FILE1]' \
- '-2[suppress lines unique to FILE2]' \
- '-3[suppress lines that appear in both files]' \
- '--help' \
- '--version' \
- '1:file1 to compare:_files' \
+local -a args
+
+args=(
+ '-1[suppress lines unique to FILE1]'
+ '-2[suppress lines unique to FILE2]'
+ '-3[suppress lines that appear in both files]'
+ '1:file1 to compare:_files'
'2:file2 to compare:_files'
+)
+
+if _pick_variant gnu=GNU unix --version; then
+ args+=(
+ '(- : *)--version[display version information]'
+ '(- : *)--help[display help information]'
+ )
+fi
+
+_arguments -s $args
reply other threads:[~2007-09-27 9:29 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a06001015c32127d35c0f@kba.biglobe.ne.jp \
--to=takimoto-j@kba.biglobe.ne.jp \
--cc=zsh-workers@sunsite.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).