mirror of
				git://git.code.sf.net/p/zsh/code
				synced 2025-10-31 18:10:56 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			49 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
	
		
			1.1 KiB
		
	
	
	
		
			Text
		
	
	
	
	
	
| #compdef 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'
 | |
|     '--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*)
 | |
|       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]' \
 | |
|   ': :_guard "^--*" "format or date"' \
 | |
|   "$args[@]"
 |