Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: _strftime: Update with -n and make 2: dynamic on -r
- X-seq: zsh-workers 47495
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: PATCH: _strftime: Update with -n and make 2: dynamic on -r
- Date: Sat, 24 Oct 2020 15:32:20 +0200
- Archived-at: <https://zsh.org/workers/47495>
- Archived-at: <http://www.zsh.org/sympa/arcsearch_id/zsh-workers/2020-10/20201024133220.17191-1-mikachu%40gmail.com>
- Authentication-results: zsh.org; iprev=pass (mail-lf1-f54.google.com) smtp.remote-ip=209.85.167.54; dkim=pass header.d=gmail.com header.s=20161025 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references; bh=mbsG9cXsELhO0U1YnAD1stUQRMoeb7HGY+/lR8eacdk=; b=tXMLv+7Le6Qi/QbPOyd9wjYD2MVy3kdBdTA9nytCWCC63y3fipORMuV3+g5txMOhh+ WObGwsZjg9AmiMdvX+TUemAxLZ0JAVU2Blq2on7BIFwuSo5fdRBJl4GhL7/K/gLfQTai mt/FYXhrZwXzVb90kmUFrqHsXhrzLfhAL5R0FMWVxQqF7KTKUZnp3fQEWBZpF98AV1j1 kqnx9W9/sDJp4uNNHRfbXUcFX4EPhWwAR2q5rO+1gUb2LGQArUjnBtK11gQKbk3nLGsa bbIdaeGBw2Zb6ruSIeqWGWY+HGIbZXCd+oQuU7QiB+q0FXzAJHgj1YW2MN94/pzy/pMh 0YcQ==
- In-reply-to: <20201024114609.12293-1-mikachu@gmail.com>
- List-archive: <http://www.zsh.org/sympa/arc/zsh-workers>
- List-help: <mailto:sympa@zsh.org?subject=help>
- List-id: <zsh-workers.zsh.org>
- List-owner: <mailto:zsh-workers-request@zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-subscribe: <mailto:sympa@zsh.org?subject=subscribe%20zsh-workers>
- List-unsubscribe: <mailto:sympa@zsh.org?subject=unsubscribe%20zsh-workers>
- References: <20201024114609.12293-1-mikachu@gmail.com>
- Sender: zsh-workers-request@xxxxxxx
---
Completion/Zsh/Command/_strftime | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/Completion/Zsh/Command/_strftime b/Completion/Zsh/Command/_strftime
index 0849f1c85c..a57a76ce44 100644
--- a/Completion/Zsh/Command/_strftime
+++ b/Completion/Zsh/Command/_strftime
@@ -1,14 +1,16 @@
#compdef strftime
-local ret=1 expl
+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:epoch time (or date string with -r)' \
+ "2:$two" \
'3:nanoseconds' \
-&& ret=0
-
-return ret
--
2.15.1
Messages sorted by:
Reverse Date,
Date,
Thread,
Author