From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14930 invoked by alias); 24 Nov 2016 17:12:46 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40013 Received: (qmail 4612 invoked from network); 24 Nov 2016 17:12:46 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-mqugw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(133.208.100.3):SA:0(-2.9/5.0):. Processed in 1.060118 secs); 24 Nov 2016 17:12:46 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: takimoto-j@kba.biglobe.ne.jp X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at spf01.biglobe.ne.jp designates 133.208.100.3 as permitted sender) X-Biglobe-Sender: From: "Jun T." Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Subject: PATCH: _date_formats and _strftime: handle zsh extensions format appropriately Message-Id: <49C9DD8B-7981-4324-A8E8-C3218F1DB163@kba.biglobe.ne.jp> Date: Fri, 25 Nov 2016 01:31:03 +0900 To: zsh-workers@zsh.org Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Biglobe-Spnum: 56135 In _date_formats, the format '%.' is a zsh extension, and its precision should be offered only if $1 =3D zsh. _strftime should call _date_formats with $1 =3D 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=3D( '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 =20 _describe -t date-format-specifier 'date format specifier' specs \ -p "${(Q)PREFIX:-%}" -S '' -_message -e date-format-precision 'precision for %%. (1-6)' +[[ $1 =3D=3D 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=3D0 =20 return ret