From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id b27a96fd for ; Sun, 3 Feb 2019 19:10:48 +0000 (UTC) Received: (qmail 24151 invoked by alias); 3 Feb 2019 19:10:27 -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: List-Unsubscribe: X-Seq: 44034 Received: (qmail 21387 invoked by uid 1010); 3 Feb 2019 19:10:27 -0000 X-Qmail-Scanner-Diagnostics: from mail-it1-f170.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.100.2/25112. spamassassin: 3.4.2. Clear:RC:0(209.85.166.170):SA:0(-1.9/5.0):. Processed in 2.674789 secs); 03 Feb 2019 19:10:27 -0000 X-Envelope-From: dana@dana.is X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dana-is.20150623.gappssmtp.com; s=20150623; h=from:content-transfer-encoding:mime-version:subject:message-id:date :to; bh=qJbZwPXKe0/tIKN1pjzog6TeIixrRkUGaNn7/sELtr0=; b=MSa6zuo4Yhjm99wVce/3OWcgY+JQmrYKxly2w3MZQJb7pIiHA/1xZ9WT1jB9HppZCq Mv4Bu0ub2OdaoQBTYzrIiDPQFsylHrQMaN1ZJfkeUaheW753ZEiyNgQSfnAqC1obyeE3 XwKPRqTX73zLGUVly0EhzMTVkkU6lSV31L2KNGtnd2ZJ8pBWvQb9BUs/OkUiq22XieZT ygzqwKmkS7EXL+ZqaU8/wzuTEKbZhZFWvrJwyJsB49LMWFsilPdmgR6iTHoMfHFvUX82 tFFwcdS2jk5v+EXl/+YbNdEia5ukS9rKkqdueRhRlOo5R46gc2Gvx0qry0nx6sXeHLMf A3TA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:content-transfer-encoding:mime-version :subject:message-id:date:to; bh=qJbZwPXKe0/tIKN1pjzog6TeIixrRkUGaNn7/sELtr0=; b=YpuCtqhWC+1EaAFsEZLhBcBe9bm5mxV7ZJZ0cqsB/re/nOkygmpCGSXRjU5fqPFuYG BoRDAwTn9OeshWeqLCMsgZHKNZUTKOBImj0xsW2E8P+8J4vL9bL5PLSiejbMdUH4AIbv WC765bzSAm3+6N2vA5KMUgcHgVYzw3FrVXKF+IH0+bj0IrYbxalqxLVFnLzcq0eL+mo9 Z1OpnhEIaNPC8EazroCfiirM6efbxYecN8r8ca0O99b988+tcwAAQKqfscfCFugBdoOQ GDt6j31TFGCzNAYLQzDU70TwNBwXq8Hg89zUhPLbIEEvydH5VYyP0LwpFoW21Gzf0JZS p6fQ== X-Gm-Message-State: AJcUukfV3sSikUl8BpfKH1fMfW+zb/1XzWg+gw8CGox7GC+1MhgJ4RNt iSTGElXK3ShRL7L6HiD7iG7bNvqWBqY= X-Google-Smtp-Source: ALg8bN4ql49oavLl2InNfkaiQl/3mCDKSzMx3GNGIhnN7vaWeDAkr1wXD5VhY5cpgV7u/PpMAs2UkQ== X-Received: by 2002:a02:6a16:: with SMTP id l22mr30431129jac.139.1549221018962; Sun, 03 Feb 2019 11:10:18 -0800 (PST) From: dana Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\)) Subject: [PATCH] Completion: _date_formats updates Message-Id: <92A6E572-C5F5-4AC0-82EB-2ACE23D92A52@dana.is> Date: Sun, 3 Feb 2019 13:10:17 -0600 To: Zsh workers X-Mailer: Apple Mail (2.3445.100.39) Some last-minute updates to _date_formats before i get to work on 5.7.1. = This is mostly to account for the nanosecond stuff (%9./%N) added recently, = but it also fixes some wording/capitalisation. This function is actually broken in some places (e.g., date + = produces weird output), apparently due to a bug in _describe related to the fact = that %b and %h share a description. It also needs additional ways for the = caller to specify the implementation, so that (for example) we can complete = properly for GNU date on non-Linux systems. But i'll look into those issues later dana diff --git a/Completion/Unix/Type/_date_formats = b/Completion/Unix/Type/_date_formats index 6bd5c6d6b..889a95779 100644 --- a/Completion/Unix/Type/_date_formats +++ b/Completion/Unix/Type/_date_formats @@ -24,7 +24,7 @@ specs=3D( 'c:preferred locale date and time' 'C:2-digit century' 'd:day of month (01-31)' - 'D:american format month/day/year (%m/%d/%y)' + 'D:American format month/day/year (%m/%d/%y)' 'e:day of month ( 1-31)' 'F:ISO 8601 year-month-date (%Y-%m-%d)' 'G:4-digit ISO 8601 week-based year' @@ -44,21 +44,25 @@ specs=3D( 'S:seconds (00-60)' 't:tab' 'T:24-hour notation with seconds (%H:%M:%S)' - 'u:day of week (1-7, 1=3Dmonday)' - 'U:week number of current year, sunday based (00-53)' + 'u:day of week (1-7, 1=3DMonday)' + 'U:week number of current year, Sunday based (00-53)' 'V:ISO 8601 week number of current year, week 1 has 4 days in current = year (01-53)' - 'w:day of week (0-6, 0=3Dsunday)' - 'W:week number of current year, monday based (00-53)' + 'w:day of week (0-6, 0=3DSunday)' + 'W:week number of current year, Monday based (00-53)' 'x:locale dependent date representation without time' 'X:locale dependent time representation without date' 'y:2-digit year (00-99)' 'Y:full year' 'z:UTC offset' 'Z:timezone name' - '%:A %' + '%:literal %' ) =20 case $OSTYPE in + linux-gnu) + [[ $1 =3D=3D zsh ]] || # %N is handled below in this case + specs+=3D( 'N:fractional part of seconds since epoch, in = nanoseconds' ) + ;| freebsd*|dragonfly*|darwin*|linux-gnu|solaris2.<11->) specs+=3D( 'E:alternate representation' @@ -91,6 +95,7 @@ if [[ $1 =3D=3D zsh ]]; then 'f:day of month (1-31)' 'K:hour (0-23)' 'L:hour (0-12)' + 'N:fractional part of seconds since epoch, in nanoseconds (%9.)' '.:fractional part of seconds since epoch' "-:don't pad numeric values" ) @@ -102,4 +107,4 @@ done =20 _describe -t date-format-specifier 'date format specifier' specs \ -p "${(Q)PREFIX:-%}" -S '' -[[ $1 =3D=3D zsh ]] && _message -e date-format-precision 'precision for = %%. (1-6)' +[[ $1 =3D=3D zsh ]] && _message -e date-format-precision 'precision for = %%. (1-9)'