File: _strftime

package info (click to toggle)
zsh 5.9-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 23,856 kB
  • sloc: ansic: 108,138; sh: 6,976; makefile: 722; perl: 687; awk: 291; sed: 16
file content (16 lines) | stat: -rw-r--r-- 347 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#compdef strftime

local expl two='epoch time'

if (( words[(I)-r] )); then
  two='date string'
fi

_arguments -S -A '-*' -s \
  '-n[omit trailing newline]' \
  '-q[run quietly]' \
  '(3)-r[reverse lookup using strptime]' \
  '-s+[assign result to parameter]:param:_parameters' \
  '1:format: _date_formats zsh' \
  "2:$two" \
  '3:nanoseconds' \