mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-09-18 15:21:16 +02:00
Hideki ONO's changes for *BSD.
This commit is contained in:
parent
9e46734898
commit
01d081b8cf
1 changed files with 125 additions and 72 deletions
|
@ -1,8 +1,60 @@
|
|||
#compdef ls gls
|
||||
# Ulrik Haugen 2001
|
||||
|
||||
local arguments
|
||||
local arguments is_gnu
|
||||
|
||||
_pick_variant -r is_gnu 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 ..]'
|
||||
|
@ -72,9 +124,10 @@ arguments=(
|
|||
'(- :)--version[display version information]'
|
||||
'*:files:_files'
|
||||
)
|
||||
|
||||
# remove long options?
|
||||
_pick_variant gnu=gnu unix --help ||
|
||||
if [[ $is_gnu != gnu ]]; then
|
||||
arguments=( ${${${arguments:#(|*\))--*}//--[^ )]#/}/\( #\)/} )
|
||||
fi
|
||||
fi
|
||||
|
||||
_arguments -s $arguments
|
||||
|
|
Loading…
Reference in a new issue