* PATCH: _ls
@ 2006-05-23 16:46 Hideki ONO
2006-05-23 17:14 ` Wayne Davison
0 siblings, 1 reply; 6+ messages in thread
From: Hideki ONO @ 2006-05-23 16:46 UTC (permalink / raw)
To: zsh-workers
add _ls support for *bsd.
could you apply this patch?
Index: _ls
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ls,v
retrieving revision 1.6
diff -u -r1.6 _ls
--- _ls 21 Nov 2003 20:29:52 -0000 1.6
+++ _ls 23 May 2006 13:35:34 -0000
@@ -3,75 +3,129 @@
local arguments
-arguments=(
- '(--all -a -A --almost-all)'{--all,-a}'[list entries starting with .]'
- '(--almost-all -A -a --all)'{--almost-all,-A}'[list all except . and ..]'
- '--author[print the author of each file]'
- '(--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,--dereference-command-line-symlink-to-dir}
- '(--recursive -R)'{--recursive,-R}'[list subdirectories recursively]'
-
- '(--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]'
- '(--inode -i)'{--inode,-i}'[print file inode numbers]'
-
- '(--format -l -g -o -1 -C -m -x)-l[long listing]'
- '(--format -l -1 -C -m -x)-g[long listing but without owner information]'
- '(--format -l --no-group -G -1 -C -m -x)-o[no group, long]'
- '(--format -l -g -o -C -m -x)-1[single column output]'
- '(--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=:format:(verbose long commas horizontal across vertical single-column)'
-
- '(--size -s -f)'{--size,-s}'[display size of each file in blocks]'
-
- '(--time -u)-c[status change time]'
- '(--time -c)-u[access time]'
- '(-c -u)--time=[specify time to show]:time:(ctime status use atime access)'
- '--time-style=[show times using specified style]:time style:(full-iso long-iso iso locale)'
-
- '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]'
- '(--reverse)'{--reverse,-r}'[reverse sort order]'
-
- '(--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=:sort:(size time none version extension)'
-
- '--color=-[control use of color]:color:(never always auto)'
-
- '(--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=:indicator style:(none file-type classify)'
-
- '(-f)--full-time[list both full date and full time]'
-
- '(--kilobytes -k --block-size)'{--kilobytes,-k}'[use block size of 1k]'
- '(-k --kilobytes)--block-size=[specify block size]:block size (bytes):(1024)'
-
- '(--numeric-uid-gid -n)'{--numeric-uid-gid,-n}'[numeric uid, gid]'
- '(--tabsize -T)'{--tabsize=,-T+}'[specify tab size]:tab size'
- '(--width -w)'{--width=,-w+}'[specify screen width]:screen width'
-
- '(--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 raw characters]'
- '(--quoting-style -b --escape -N --literal -Q --quote-name)'{--quote-name,-Q}'[quote names]'
- '(-b --escape -N --literal -Q --quote-name)--quoting-style=:quoting style:(literal shell shell-always c escape clocale locale)'
-
- '(--hide-control-chars -q --show-control-chars)'{--hide-control-chars,-q}'[hide control chars]'
- '(-q --hide-control-chars)--show-control-chars'
- '(- :)--help[display help information]'
- '(- :)--version[display version information]'
- '*:files:_files'
-)
+case "$OSTYPE" in
+ netbsd*|freebsd*|openbsd*)
+ arguments=(
+ '(-A)-a[list entries starting with .]'
+ '(-a)-A[list all except . and ..]'
+ '-d[list directory entries instead of contents]'
+ '-L[list referenced file for sym link]'
+ '-R[list subdirectories recursively]'
+
+ '(-k)-h[print sizes in human readable form]'
+ '(-h)-k[print sizes of 1k]'
+
+ '-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]'
+ '(-l -g -1 -C -m)-x[sort horizontally]'
+
+ '-o[display file flags]'
+
+ '-s[display size of each file in blocks]'
+
+ '(-u)-c[status change time]'
+ '(-c)-u[access time]'
+
+ '-f[unsorted, all, short list]'
+ '-r[reverse sort order]'
+
+ '(-t)-S[sort by size]'
+ '(-S)-t[sort by modification time]'
+
+ '(-p)-F[append file type indicators]'
+ '(-F)-p[append file type indicators for directory]'
+
+ '-f[output is not sorted]'
+
+ '-n[numeric uid, gid]'
+
+ '-T[show complete time information]'
+
+ '(-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)-q[hide control chars]'
+ '(-B -b -w -q)-w[print raw characters]'
+
+ '*:files:_files'
+ )
+ ;;
+*)
+ arguments=(
+ '(--all -a -A --almost-all)'{--all,-a}'[list entries starting with .]'
+ '(--almost-all -A -a --all)'{--almost-all,-A}'[list all except . and ..]'
+ '--author[print the author of each file]'
+ '(--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,--dereference-command-line-symlink-to-dir}
+ '(--recursive -R)'{--recursive,-R}'[list subdirectories recursively]'
+
+ '(--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]'
+ '(--inode -i)'{--inode,-i}'[print file inode numbers]'
+
+ '(--format -l -g -o -1 -C -m -x)-l[long listing]'
+ '(--format -l -1 -C -m -x)-g[long listing but without owner information]'
+ '(--format -l --no-group -G -1 -C -m -x)-o[no group, long]'
+ '(--format -l -g -o -C -m -x)-1[single column output]'
+ '(--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=:format:(verbose long commas horizontal across vertical single-column)'
+
+ '(--size -s -f)'{--size,-s}'[display size of each file in blocks]'
+
+ '(--time -u)-c[status change time]'
+ '(--time -c)-u[access time]'
+ '(-c -u)--time=[specify time to show]:time:(ctime status use atime access)'
+ '--time-style=[show times using specified style]:time style:(full-iso long-iso iso locale)'
+
+ '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]'
+ '(--reverse)'{--reverse,-r}'[reverse sort order]'
+
+ '(--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=:sort:(size time none version extension)'
+
+ '--color=-[control use of color]:color:(never always auto)'
+
+ '(--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=:indicator style:(none file-type classify)'
+
+ '(-f)--full-time[list both full date and full time]'
+
+ '(--kilobytes -k --block-size)'{--kilobytes,-k}'[use block size of 1k]'
+ '(-k --kilobytes)--block-size=[specify block size]:block size (bytes):(1024)'
+
+ '(--numeric-uid-gid -n)'{--numeric-uid-gid,-n}'[numeric uid, gid]'
+ '(--tabsize -T)'{--tabsize=,-T+}'[specify tab size]:tab size'
+ '(--width -w)'{--width=,-w+}'[specify screen width]:screen width'
+
+ '(--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 raw characters]'
+ '(--quoting-style -b --escape -N --literal -Q --quote-name)'{--quote-name,-Q}'[quote names]'
+ '(-b --escape -N --literal -Q --quote-name)--quoting-style=:quoting style:(literal shell shell-always c escape clocale locale)'
+
+ '(--hide-control-chars -q --show-control-chars)'{--hide-control-chars,-q}'[hide control chars]'
+ '(-q --hide-control-chars)--show-control-chars'
+ '(- :)--help[display help information]'
+ '(- :)--version[display version information]'
+ '*:files:_files'
+ )
+ ;;
+esac
# remove long options?
_pick_variant gnu=gnu unix --help ||
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: _ls
2006-05-23 16:46 PATCH: _ls Hideki ONO
@ 2006-05-23 17:14 ` Wayne Davison
2006-05-24 2:15 ` Hideki ONO
0 siblings, 1 reply; 6+ messages in thread
From: Wayne Davison @ 2006-05-23 17:14 UTC (permalink / raw)
To: Hideki ONO; +Cc: zsh-workers
On Wed, May 24, 2006 at 01:46:27AM +0900, Hideki ONO wrote:
> add _ls support for *bsd.
> could you apply this patch?
This isn't quite right because the script is trying to use _pick_variant
to figure out if the tool is a GNU version or not, and this check was
not affected by your patch. Also, if the user ran gls, presumably we
would need to use the GNU options even on *bsd. So, a little more
tweaking of your patch looks to be needed (which I don't have the time
to do at the moment, alas).
..wayne..
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: _ls
2006-05-23 17:14 ` Wayne Davison
@ 2006-05-24 2:15 ` Hideki ONO
2006-05-25 8:10 ` Wayne Davison
0 siblings, 1 reply; 6+ messages in thread
From: Hideki ONO @ 2006-05-24 2:15 UTC (permalink / raw)
To: Wayne Davison; +Cc: zsh-workers
> This isn't quite right because the script is trying to use _pick_variant
> to figure out if the tool is a GNU version or not, and this check was
> not affected by your patch. Also, if the user ran gls, presumably we
> would need to use the GNU options even on *bsd. So, a little more
> tweaking of your patch looks to be needed (which I don't have the time
> to do at the moment, alas).
I fixed to use _pick_variant even on *bsd.
How about this one?
Index: _ls
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_ls,v
retrieving revision 1.6
diff -u -r1.6 _ls
--- _ls 21 Nov 2003 20:29:52 -0000 1.6
+++ _ls 24 May 2006 02:14:23 -0000
@@ -1,80 +1,134 @@
#compdef ls gls
# Ulrik Haugen 2001
-local arguments
+local arguments is_gnu
-arguments=(
- '(--all -a -A --almost-all)'{--all,-a}'[list entries starting with .]'
- '(--almost-all -A -a --all)'{--almost-all,-A}'[list all except . and ..]'
- '--author[print the author of each file]'
- '(--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,--dereference-command-line-symlink-to-dir}
- '(--recursive -R)'{--recursive,-R}'[list subdirectories recursively]'
-
- '(--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]'
- '(--inode -i)'{--inode,-i}'[print file inode numbers]'
-
- '(--format -l -g -o -1 -C -m -x)-l[long listing]'
- '(--format -l -1 -C -m -x)-g[long listing but without owner information]'
- '(--format -l --no-group -G -1 -C -m -x)-o[no group, long]'
- '(--format -l -g -o -C -m -x)-1[single column output]'
- '(--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=:format:(verbose long commas horizontal across vertical single-column)'
-
- '(--size -s -f)'{--size,-s}'[display size of each file in blocks]'
-
- '(--time -u)-c[status change time]'
- '(--time -c)-u[access time]'
- '(-c -u)--time=[specify time to show]:time:(ctime status use atime access)'
- '--time-style=[show times using specified style]:time style:(full-iso long-iso iso locale)'
-
- '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]'
- '(--reverse)'{--reverse,-r}'[reverse sort order]'
-
- '(--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=:sort:(size time none version extension)'
-
- '--color=-[control use of color]:color:(never always auto)'
-
- '(--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=:indicator style:(none file-type classify)'
-
- '(-f)--full-time[list both full date and full time]'
-
- '(--kilobytes -k --block-size)'{--kilobytes,-k}'[use block size of 1k]'
- '(-k --kilobytes)--block-size=[specify block size]:block size (bytes):(1024)'
-
- '(--numeric-uid-gid -n)'{--numeric-uid-gid,-n}'[numeric uid, gid]'
- '(--tabsize -T)'{--tabsize=,-T+}'[specify tab size]:tab size'
- '(--width -w)'{--width=,-w+}'[specify screen width]:screen width'
-
- '(--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 raw characters]'
- '(--quoting-style -b --escape -N --literal -Q --quote-name)'{--quote-name,-Q}'[quote names]'
- '(-b --escape -N --literal -Q --quote-name)--quoting-style=:quoting style:(literal shell shell-always c escape clocale locale)'
-
- '(--hide-control-chars -q --show-control-chars)'{--hide-control-chars,-q}'[hide control chars]'
- '(-q --hide-control-chars)--show-control-chars'
- '(- :)--help[display help information]'
- '(- :)--version[display version information]'
- '*:files:_files'
-)
+_pick_variant -r is_gnu gnu=gnu unix --help
-# remove long options?
-_pick_variant gnu=gnu unix --help ||
+if [[ "$OSTYPE" = (netbsd*|freebsd*|openbsd*) && "$is_gnu" != gnu ]]; then
+ arguments=(
+ '(-A)-a[list entries starting with .]'
+ '(-a)-A[list all except . and ..]'
+ '-d[list directory entries instead of contents]'
+ '-L[list referenced file for sym link]'
+ '-R[list subdirectories recursively]'
+
+ '(-k)-h[print sizes in human readable form]'
+ '(-h)-k[print sizes of 1k]'
+
+ '-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]'
+ '(-l -g -1 -C -m)-x[sort horizontally]'
+
+ '-o[display file flags]'
+
+ '-s[display size of each file in blocks]'
+
+ '(-u)-c[status change time]'
+ '(-c)-u[access time]'
+
+ '-f[unsorted, all, short list]'
+ '-r[reverse sort order]'
+
+ '(-t)-S[sort by size]'
+ '(-S)-t[sort by modification time]'
+
+ '(-p)-F[append file type indicators]'
+ '(-F)-p[append file type indicators for directory]'
+
+ '-f[output is not sorted]'
+
+ '-n[numeric uid, gid]'
+
+ '-T[show complete time information]'
+
+ '(-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)-q[hide control chars]'
+ '(-B -b -w -q)-w[print raw characters]'
+
+ '*:files:_files'
+ )
+else
+ arguments=(
+ '(--all -a -A --almost-all)'{--all,-a}'[list entries starting with .]'
+ '(--almost-all -A -a --all)'{--almost-all,-A}'[list all except . and ..]'
+ '--author[print the author of each file]'
+ '(--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,--dereference-command-line-symlink-to-dir}
+ '(--recursive -R)'{--recursive,-R}'[list subdirectories recursively]'
+
+ '(--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]'
+ '(--inode -i)'{--inode,-i}'[print file inode numbers]'
+
+ '(--format -l -g -o -1 -C -m -x)-l[long listing]'
+ '(--format -l -1 -C -m -x)-g[long listing but without owner information]'
+ '(--format -l --no-group -G -1 -C -m -x)-o[no group, long]'
+ '(--format -l -g -o -C -m -x)-1[single column output]'
+ '(--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=:format:(verbose long commas horizontal across vertical single-column)'
+
+ '(--size -s -f)'{--size,-s}'[display size of each file in blocks]'
+
+ '(--time -u)-c[status change time]'
+ '(--time -c)-u[access time]'
+ '(-c -u)--time=[specify time to show]:time:(ctime status use atime access)'
+ '--time-style=[show times using specified style]:time style:(full-iso long-iso iso locale)'
+
+ '(-a --all -U -l --format -s --size -t --sort --full-time)-f[unsorted, all, short list]'
+ '(--reverse)'{--reverse,-r}'[reverse sort order]'
+
+ '(--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=:sort:(size time none version extension)'
+
+ '--color=-[control use of color]:color:(never always auto)'
+
+ '(--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=:indicator style:(none file-type classify)'
+
+ '(-f)--full-time[list both full date and full time]'
+
+ '(--kilobytes -k --block-size)'{--kilobytes,-k}'[use block size of 1k]'
+ '(-k --kilobytes)--block-size=[specify block size]:block size (bytes):(1024)'
+
+ '(--numeric-uid-gid -n)'{--numeric-uid-gid,-n}'[numeric uid, gid]'
+ '(--tabsize -T)'{--tabsize=,-T+}'[specify tab size]:tab size'
+ '(--width -w)'{--width=,-w+}'[specify screen width]:screen width'
+
+ '(--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 raw characters]'
+ '(--quoting-style -b --escape -N --literal -Q --quote-name)'{--quote-name,-Q}'[quote names]'
+ '(-b --escape -N --literal -Q --quote-name)--quoting-style=:quoting style:(literal shell shell-always c escape clocale locale)'
+
+ '(--hide-control-chars -q --show-control-chars)'{--hide-control-chars,-q}'[hide control chars]'
+ '(-q --hide-control-chars)--show-control-chars'
+ '(- :)--help[display help information]'
+ '(- :)--version[display version information]'
+ '*:files:_files'
+ )
+ # remove long options?
+ if [[ $is_gnu != gnu ]]; then
arguments=( ${${${arguments:#(|*\))--*}//--[^ )]#/}/\( #\)/} )
+ fi
+fi
+
_arguments -s $arguments
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: _ls
2006-05-24 2:15 ` Hideki ONO
@ 2006-05-25 8:10 ` Wayne Davison
2006-05-26 17:41 ` Wayne Davison
0 siblings, 1 reply; 6+ messages in thread
From: Wayne Davison @ 2006-05-25 8:10 UTC (permalink / raw)
To: Hideki ONO; +Cc: zsh-workers
On Wed, May 24, 2006 at 11:15:47AM +0900, Hideki ONO wrote:
> I fixed to use _pick_variant even on *bsd.
> How about this one?
That looks quite good to me. I tested it a bit, and the new code seems
to be working as expected, so I checked it in. Thanks!
While I was testing it, I discovered that the completion system is not
completing the options to gnu ls correctly, which appears to be a bug:
Several options get lost, including --format, -1, -x, and --color (I did
not do an exhaustive search to know exactly how many). If I get rid of
the rule defining -F, many of these missing options come back (though
not --color). Very strange, but totally unrelated to the just-committed
changes.
..wayne..
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: _ls
2006-05-25 8:10 ` Wayne Davison
@ 2006-05-26 17:41 ` Wayne Davison
2006-05-26 17:49 ` Peter Stephenson
0 siblings, 1 reply; 6+ messages in thread
From: Wayne Davison @ 2006-05-26 17:41 UTC (permalink / raw)
To: zsh-workers
On Thu, May 25, 2006 at 01:10:40AM -0700, Wayne Davison wrote:
> While I was testing it, I discovered that the completion system is not
> completing the options to gnu ls correctly, which appears to be a bug:
I forgot to follow up to this earlier. This turned out to be due to an
alias I have for "ls" (ls="command ls --color=auto -CF"). Oops!
This does bring up an interesting point about the exclusions that are
currently in the completion system. With a utility like ls, conflicting
options are accepted, with the last one having precedence. So, even
though my alias specifies -C, I can still override that with -x. So,
should we avoid excluding options that may conflict ideologically as
long as they don't conflict syntactically?
..wayne..
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: PATCH: _ls
2006-05-26 17:41 ` Wayne Davison
@ 2006-05-26 17:49 ` Peter Stephenson
0 siblings, 0 replies; 6+ messages in thread
From: Peter Stephenson @ 2006-05-26 17:49 UTC (permalink / raw)
To: zsh-workers
Wayne Davison wrote:
> This does bring up an interesting point about the exclusions that are
> currently in the completion system. With a utility like ls, conflicting
> options are accepted, with the last one having precedence. So, even
> though my alias specifies -C, I can still override that with -x. So,
> should we avoid excluding options that may conflict ideologically as
> long as they don't conflict syntactically?
We could introduce a style, and get around the problem in the usual way.
--
Peter Stephenson <pws@csr.com> Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK Tel: +44 (0)1223 692070
To access the latest news from CSR copy this link into a web browser: http://www.csr.com/email_sig.php
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-05-26 17:49 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-23 16:46 PATCH: _ls Hideki ONO
2006-05-23 17:14 ` Wayne Davison
2006-05-24 2:15 ` Hideki ONO
2006-05-25 8:10 ` Wayne Davison
2006-05-26 17:41 ` Wayne Davison
2006-05-26 17:49 ` Peter Stephenson
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).