1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-01 06:20:55 +01:00

21712: include fallback for where $OSTYPE is not matched

This commit is contained in:
Oliver Kiddle 2005-12-05 14:16:05 +00:00
parent 98c7796a3a
commit eec9d17837
2 changed files with 46 additions and 41 deletions

View file

@ -1,3 +1,8 @@
2005-12-05 Oliver Kiddle <opk@zsh.org>
* 21712: Completion/Unix/Command/_date: include fallback for
where $OSTYPE is not matched
2005-12-04 Bart Schaefer <schaefer@zsh.org>
* unposted (cf. users/9744): Functions/Zle/keeper: call

View file

@ -1,48 +1,48 @@
#compdef date
if _pick_variant -r is_gnu gnu="Free Software Foundation" unix --version; then
_arguments \
'-d[date]:time string:' \
'-f[file]:date file:_files' \
'-I[iso-8601]:time spec:' \
'-r[reference]:file:_files' \
'-R[rfc-2822]' \
'-s[set]:time string:' \
'-u[utc]' \
-- \
'*=FILE*:file:_files' \
'*=DATEFILE*:date file:_files' \
':format or date:'
local -a args
if _pick_variant gnu="Free Software Foundation" unix --version; then
args=(
'-d[output specified date]:time string'
'-f[output dates specified in file]:file:_files'
'-I-[iso-8601]:precision:(date hours minutes seconds)'
'-r[reference]:file:_files'
'-R[rfc-2822]'
'-s[set]:time string'
--
'*=FILE*:file:_files'
'*=DATEFILE*:date file:_files'
)
else
case "$OSTYPE" in
(solaris*)
_arguments \
'-u[utc]' \
'-a:adjustment:' \
':format or date:'
;;
(freebsd*)
_arguments \
'-u[utc]' \
'-n[only set time on current machine]' \
'-d:daylight savingg time value:' \
'-j[do not try to set date]' \
'-f:parsing format:' \
'-r:seconds since epoch:' \
'-t:minutes west of GMT:' \
'-v:adjustment value:' \
':format or date:'
;;
(openbsd*)
_arguments \
'-u[utc]' \
'-n[only set time on current machine]' \
'-d:daylight savingg time value:' \
'-a[gradually skew]' \
'-r:seconds since epoch:' \
'-t:minutes west of GMT:' \
':format or date:'
;;
solaris*)
args=( '-a:adjustment' )
;;
freebsd*)
args=(
'-n[only set time on current machine]'
'-d:daylight saving time value'
'-j[do not try to set date]'
'-f:parsing format'
'-r:seconds since epoch'
'-t:minutes west of GMT'
'-v:adjustment value'
)
;;
openbsd*)
args=(
'-n[only set time on current machine]'
'-d:daylight saving time value'
'-a[gradually skew]'
'-r:seconds since epoch'
'-t:minutes west of GMT'
)
;;
esac
fi
_arguments \
'-u[display or set time in UTC]' \
':format or date' \
$args[@]