diff options
author | Oliver Kiddle <opk@zsh.org> | 2015-07-07 22:59:00 +0200 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2015-07-07 22:59:00 +0200 |
commit | 396f68971fef574160e780c01d12a58747f5d224 (patch) | |
tree | 1ad9bdf79a4dddc8714cb9f222026aa930101e63 /Completion/Zsh | |
parent | 04675eca4ce9396d1efd0563b2b786f5bc6d66ed (diff) | |
download | zsh-396f68971fef574160e780c01d12a58747f5d224.tar.gz zsh-396f68971fef574160e780c01d12a58747f5d224.tar.xz zsh-396f68971fef574160e780c01d12a58747f5d224.zip |
35718: new calendar style date completion
Diffstat (limited to 'Completion/Zsh')
-rw-r--r-- | Completion/Zsh/Type/_globquals | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Completion/Zsh/Type/_globquals b/Completion/Zsh/Type/_globquals index 042b27400..5cdb8f7c4 100644 --- a/Completion/Zsh/Type/_globquals +++ b/Completion/Zsh/Type/_globquals @@ -1,7 +1,7 @@ #autoload local state=qual expl char delim timespec -local -a alts +local -a alts tdisp sdisp local -A specmap while [[ -n $PREFIX ]]; do @@ -117,14 +117,15 @@ while [[ -n $PREFIX ]]; do alts=() timespec=$PREFIX[1] if ! compset -P '[Mwhmsd]' && [[ -z $PREFIX ]]; then - alts+=("time-specifiers:time specifier:\ -((M\:months w\:weeks h\:hours m:\minutes s\:seconds d\:days))") + tdisp=( seconds minutes hours days weeks Months ) + alts+=( "time-specifiers:time specifier:compadd -E 0 -d tdisp -S '' - s m h d w M" ) fi if ! compset -P '[-+]' && [[ -z $PREFIX ]]; then - alts+=("senses:sense:((-\:less\ than +\:more\ than))") + sdisp=( before exactly since ) + alts+=("senses:sense:compadd -E 0 -d sdisp -S '' - + '' -") fi specmap=( M months w weeks h hours m minutes s seconds '(|+|-|d)' days) - alts+=('digits:digit ('${${specmap[(K)$timespec]}:-invalid time specifier}'):' ) + alts+=('digits:digit ('${${specmap[(K)$timespec]}:-invalid time specifier}'):_dates -f ${${timespec/[-+]/d}:-d} -S ""' ) _alternative $alts return fi |