zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _date_formats and _strftime: handle zsh extensions format appropriately
@ 2016-11-24 16:31 Jun T.
  0 siblings, 0 replies; only message in thread
From: Jun T. @ 2016-11-24 16:31 UTC (permalink / raw)
  To: zsh-workers

In _date_formats, the format '%.' is a zsh extension, and its precision
should be offered only if $1 = zsh.

_strftime should call _date_formats with $1 = zsh, since strftime
builtin (from zsh/datetime module) can handle zsh extension.


diff --git a/Completion/Unix/Type/_date_formats b/Completion/Unix/Type/_date_formats
index 45bda82..6bd5c6d 100644
--- a/Completion/Unix/Type/_date_formats
+++ b/Completion/Unix/Type/_date_formats
@@ -32,7 +32,7 @@ specs=(
   'H:hour (00-23)'
   'I:hour (01-12)'
   'j:day of year (001-366)'
-  'k:hour ( 1-23)'
+  'k:hour ( 0-23)'
   'l:hour ( 1-12)'
   'm:month (01-12)'
   'M:minute (00-59)'
@@ -102,4 +102,4 @@ done
 
 _describe -t date-format-specifier 'date format specifier' specs \
     -p "${(Q)PREFIX:-%}" -S ''
-_message -e date-format-precision 'precision for %%. (1-6)'
+[[ $1 == zsh ]] && _message -e date-format-precision 'precision for %%. (1-6)'
diff --git a/Completion/Zsh/Command/_strftime b/Completion/Zsh/Command/_strftime
index 0be7b07..24ff7dc 100644
--- a/Completion/Zsh/Command/_strftime
+++ b/Completion/Zsh/Command/_strftime
@@ -6,7 +6,7 @@ _arguments -S -A '-*' -s \
   '-q[run quietly]' \
   '-r[reverse lookup using strptime]' \
   '-s+[assign result to parameter]:param:_parameters' \
-  '1:format: _date_formats' \
+  '1:format: _date_formats zsh' \
   '2:epoch time (or date string with -r)' && ret=0
 
 return ret



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-24 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-24 16:31 PATCH: _date_formats and _strftime: handle zsh extensions format appropriately Jun T.

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).