From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3859 invoked by alias); 25 Apr 2017 04:15:07 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 41006 Received: (qmail 13990 invoked from network); 25 Apr 2017 04:15:07 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(133.208.100.2):SA:0(-0.7/5.0):. Processed in 0.835543 secs); 25 Apr 2017 04:15:07 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf01.biglobe.ne.jp designates 133.208.100.2 as permitted sender) X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: [PATCH] update _ls Message-Id: Date: Tue, 25 Apr 2017 12:28:01 +0900 To: "zsh-workers@zsh.org" Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) X-Mailer: Apple Mail (2.1510) X-Biglobe-Spnum: 49480 Solaris: I assume -S and -k are supported, and -b does not use C-escape but octal. Am I correct? BSDs: dragonfly/freebsd ignores -g openbsd doesn't have -b -B -w, but has -H dragonfly has -G -P -H new option -W (except on openbsd) several new options specific to each of netbsd/freebsd/darwin Linux: --ignore/-I/--hide can be specified multiple times -H is not a synonym of --si (but of --dereference-command-line) -p is not a synonym of --file-type diff --git a/Completion/Unix/Command/_ls b/Completion/Unix/Command/_ls index ca20107..955b089 100644 --- a/Completion/Unix/Command/_ls +++ b/Completion/Unix/Command/_ls @@ -11,10 +11,10 @@ if ! _pick_variant gnu=3Dgnu unix --help; then '-R[list subdirectories recursively]' =20 '(-k)-h[print sizes in human readable form]' + '(-h)-k[print sizes in kilobytes]' =20 '-i[print file inode numbers]' '(-l -g -1 -C -m -x)-l[long listing]' - '(-l -1 -C -m -x)-g[long listing but without owner information]' '(-l -g -C -m -x)-1[single column output]' '(-l -g -1 -m -x)-C[list entries in columns sorted vertically]' '(-l -g -1 -C -x)-m[comma separated]' @@ -27,6 +27,7 @@ if ! _pick_variant gnu=3Dgnu unix --help; then =20 '-r[reverse sort order]' =20 + '(-t)-S[sort by size]' '(-S)-t[sort by modification time]' =20 '(-p)-F[append file type indicators]' @@ -34,31 +35,80 @@ if ! _pick_variant gnu=3Dgnu unix --help; then =20 '-n[numeric uid, gid]' =20 - '(-B -b -w -q)-b[as -B, but use C escape codes whenever possible]' '(-B -b -w -q)-q[hide control chars]' =20 '*:files:_files' ) if [[ "$OSTYPE" =3D (netbsd*|dragonfly*|freebsd*|openbsd*|darwin*) = ]]; then arguments+=3D( - '(-h)-k[print sizes of 1k]' - '(-t)-S[sort by size]' '-T[show complete time information]' - '-o[display file flags]' - '-f[output is not sorted]' - '(-B -b -w -q)-w[print raw characters]' + '(-a -A -r -S -t)-f[output is not sorted]' + ) + fi + if [[ $OSTYPE =3D (netbsd*|dragonfly*|freebsd*|openbsd*) ]]; then + arguments+=3D( '-o[display file flags]' ) + fi + if [[ $OSTYPE =3D (netbsd*|dragonfly*|freebsd*|darwin*) ]]; then + arguments+=3D( '(-B -b -w -q)-B[print octal escapes for control characters]' + '(-B -b -w -q)-b[as -B, but use C escape codes whenever = possible]' + '(-B -b -w -q)-w[print raw characters]' + '-W[display whiteouts when scanning directories]' ) fi - if [[ "$OSTYPE" =3D (freebsd*|darwin*) ]]; then + if [[ $OSTYPE =3D (netbsd*|openbsd*|darwin*|solaris*) ]]; then + arguments+=3D( + '(-l -1 -C -m -x)-g[long listing but without owner information]' + ) + fi + if [[ $OSTYPE =3D netbsd* ]]; then + arguments+=3D( + '-M[output file sizes in comma-separated form]' + '-O[output only leaf (non-directory) files]' + '-P[print full pathname for each file]' + "-X[don't cross mount points when recursing]" + ) + fi + if [[ $OSTYPE =3D (dragonfly*|freebsd*|openbsd*|darwin*) ]]; then + arguments+=3D( '-H[follow symlinks on the command line]' ) + fi + if [[ $OSTYPE =3D (dragonfly*|freebsd*|darwin*) ]]; then arguments+=3D( '-G[enable colorized output]' - '-H[follow symlinks on the command line]' '-P[do not follow symlinks]' ) fi + if [[ $OSTYPE =3D (dragonfly*|freebsd*) ]]; then + arguments+=3D( + '(-A)-I[prevent -A from being automatically set for the = super-user]' + ) + fi + if [[ $OSTYPE =3D dragonfly* ]]; then + arguments+=3D( '-y[display FSMID in long listing]' ) + fi + if [[ $OSTYPE =3D (freebsd*|darwin*) ]]; then + arguments+=3D( '(-c -u)-U[file creation time]' ) + fi + if [[ $OSTYPE =3D freebsd* ]]; then + arguments+=3D( + '-,[print file sizes grouped and separated by thousands]' + '-D+[specify format for date]:format: _date_formats' + '-y[with -t, sort filenames in the same order as the time]' + '-Z[display MAC label]' + ) + fi + if [[ $OSTYPE =3D darwin* ]]; then + arguments+=3D( + '-@[display extended attribute keys and sizes in long listing]' + '-e[display ACL in long listing]' + '(-l -1 -C -m -x)-o[long listing but without group information]' + '-O[display file flags]' + '-v[print raw characters]' + ) + fi if [[ $OSTYPE =3D solaris* ]]; then arguments+=3D( + '(-q)-b[print octal escapes for control characters]' '(-l -1 -C -m -x)-o[long listing but without group information]' '(-l -t -s -r -a)-f[interpret each argument as a directory]' '(-E -l)-e[long listing with full and consistent date/time]' @@ -78,14 +128,15 @@ else '(--ignore-backups -B)'{--ignore-backups,-B}"[don't list entries = ending with ~]" '(--directory -d)'{--directory,-d}'[list directory entries instead = of contents]' '(--dired -D)'{--dired,-D}"[generate output designed for Emacs' = dired mode]" - '(--ignore -I)'{--ignore,-I}"[don't list entire matching = pattern]:pattern:" - '(--dereference -L --dereference-command-line = --dereference-command-line-symlink-to-dir)'{--dereference,-L}'[list = referenced file for sym link]' - '(--dereference -L --dereference-command-line = --dereference-command-line-symlink-to-dir)'{--dereference-command-line,--d= ereference-command-line-symlink-to-dir} + '*'{--ignore=3D,-I+}"[don't list entries matching pattern]:pattern: = " + '(--dereference -L --dereference-command-line -H = --dereference-command-line-symlink-to-dir)'{--dereference,-L}'[list = referenced file for sym link]' + '(--dereference -L --dereference-command-line -H = --dereference-command-line-symlink-to-dir)'{--dereference-command-line,-H}= '[follow symlink on the command line]' + '(--dereference -L --dereference-command-line = -H)'--dereference-command-line-symlink-to-dir '(--recursive -R)'{--recursive,-R}'[list subdirectories = recursively]' =20 '(--no-group -G)'{--no-group,-G}'[inhibit display of group = information]' - '(--human-readable -h -H --si)'{--human-readable,-h}'[print sizes = in human readable form]' - '(--si -H -h --human-readable)'{--si,-H}'[sizes in human readable = form; powers of 1000]' + '(--block-size --human-readable -h --si --kilobytes = -k)'{--human-readable,-h}'[print sizes in human readable form]' + '(--block-size --human-readable -h --si --kilobytes -k)--si[sizes = in human readable form; powers of 1000]' '(--inode -i)'{--inode,-i}'[print file inode numbers]' =20 '(--format -l -g -o -1 -C -m -x)-l[long listing]' @@ -96,7 +147,7 @@ else '(--format -l -g -o -1 -m -x)-C[list entries in columns sorted = vertically]' '(--format -l -g -o -1 -C -x)-m[comma separated]' '(--format -l -g -o -1 -C -m)-x[sort horizontally]' - '(-l -g -o -1 -C -m -x)--format=3D:format:(verbose long commas = horizontal across vertical single-column)' + '(-l -g -o -1 -C -m -x)--format=3D[specify output = format]:format:(verbose long commas horizontal across vertical = single-column)' =20 '(--size -s -f)'{--size,-s}'[display size of each file in blocks]' =20 @@ -106,25 +157,26 @@ else '--time-style=3D[show times using specified style]:style: = _alternative "time-styles\:time style\:(full-iso long-iso iso locale)" = $datef' =20 '(-a --all -U -l --format -s --size -t --sort = --full-time)-f[unsorted, all, short list]' - '(--reverse)'{--reverse,-r}'[reverse sort order]' + '(--reverse -r -U -f)'{--reverse,-r}'[reverse sort order]' =20 '(--sort -t -U -v -X)-S[sort by size]' '(--sort -S -U -v -X)-t[sort by modification time]' '(--sort -S -t -v -X)-U[unsorted]' '(--sort -S -t -U -X)-v[sort by version (filename treated = numerically)]' '(--sort -S -t -U -v)-X[sort by extension]' - '(-S -t -U -v -X)--sort=3D:sort:(size time none version extension)' + '(-S -t -U -v -X)--sort=3D[specify sort key]:sort key:(size time = none version extension)' =20 '--color=3D-[control use of color]:color:(never always auto)' - "--hide=3D[don't list entries matching pattern]:pattern" + "*--hide=3D[like -I, but overridden by -a or -A]:pattern: " '(--classify -F --indicator-style -p = --file-type)'{--classify,-F}'[append file type indicators]' - '(--file-type -p --indicator-style -F = --classify)'{--file-type,-p}'[append file type indicators except *]' - '(-F --classify -p --file-type)--indicator-style=3D:indicator = style:(none file-type classify slash)' + '(--file-type -p --indicator-style -F --classify)--file-type[append = file type indicators except *]' + '(--file-type -p --indicator-style -F --classify)-p[append / to = directories]' + '(-F --classify -p --file-type)--indicator-style=3D[specify = indicator style]:indicator style:(none file-type classify slash)' =20 '(-f)--full-time[list both full date and full time]' =20 - '(--kilobytes -k --block-size)'{--kilobytes,-k}'[use block size of = 1k]' - '(-k --kilobytes)--block-size=3D[specify block size]:block size = (bytes):(1024)' + '(--block-size --human-readable -h --si --kilobytes = -k)'{--kilobytes,-k}'[use block size of 1k]' + '(--human-readable -h --si --kilobytes -k)--block-size=3D[specify = block size]:block size (bytes):(1024)' =20 '(--numeric-uid-gid -n)'{--numeric-uid-gid,-n}'[numeric uid, gid]' '(--tabsize -T)'{--tabsize=3D,-T+}'[specify tab size]:tab size' @@ -133,7 +185,7 @@ else '(--quoting-style -b --escape -N --literal -Q = --quote-name)'{--escape,-b}'[print octal escapes for control = characters]' '(--quoting-style -b --escape -N --literal -Q = --quote-name)'{--literal,-N}'[print entry names without quoting]' '(--quoting-style -b --escape -N --literal -Q = --quote-name)'{--quote-name,-Q}'[quote names]' - '(-b --escape -N --literal -Q --quote-name)--quoting-style=3D:quoting= style:(literal shell shell-always c escape clocale locale)' + '(-b --escape -N --literal -Q --quote-name)--quoting-style=3D[specify= quoting style]:quoting style:(literal shell shell-always c escape = clocale locale)' =20 '(--hide-control-chars -q = --show-control-chars)'{--hide-control-chars,-q}'[hide control chars]' '(-q --hide-control-chars)--show-control-chars' @@ -148,4 +200,4 @@ else fi fi =20 -_arguments -s $arguments +_arguments -s -S : $arguments