1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-04 10:41:11 +02:00
zsh/Completion/Unix/Command/_date
Oliver Kiddle ab7ec8d985 35011: update completions for some common Unix commands,
in particular improving FreeBSD support
2015-05-03 16:53:57 +02:00

46 lines
1.2 KiB
Text

#compdef date gdate
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[RFC2822 format]'
'-s[set]:time string'
'--rfc-3339=-[output date and time in RFC 3339 format]:output type:(date seconds ns)'
--
'*=FILE*:file:_files'
'*=DATEFILE*:date file:_files'
)
else
case "$OSTYPE" in
solaris*)
args=( '-a:adjustment' )
;;
freebsd*|darwin*|dragonfly*|netbsd*|openbsd*)
args=(
'-n[only set time on current machine]'
'-d:daylight saving time value'
'-j[do not try to set date]'
'-r:seconds since epoch'
'-t:minutes west of GMT'
)
;|
freebsd*) args+=( '-R[RFC2822 format]' ) ;|
freebsd*|dragonfly*|darwin*)
args+=( '-f:parsing format' '-v:adjustment value' )
;;
openbsd*)
args+=( '-z[specify timezone for output]:time zone:_time_zone')
;|
openbsd*|netbsd*) args=( '-a[gradually skew]' ) ;;
esac
fi
_arguments \
'-u[display or set time in UTC]' \
': :_guard "^--*" "format or date"' \
"$args[@]"