From 396f68971fef574160e780c01d12a58747f5d224 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Tue, 7 Jul 2015 22:59:00 +0200 Subject: 35718: new calendar style date completion --- Completion/Zsh/Type/_globquals | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Completion/Zsh') 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 -- cgit 1.4.1