From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4706 invoked by alias); 15 Aug 2018 21:13:24 -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: 43302 Received: (qmail 7805 invoked by uid 1010); 15 Aug 2018 21:13:24 -0000 X-Qmail-Scanner-Diagnostics: from mail-it0-f48.google.com 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(209.85.214.48):SA:0(-1.9/5.0):. Processed in 2.916191 secs); 15 Aug 2018 21:13:24 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, SPF_PASS,T_DKIMWL_WL_MED,T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 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=FNQ0C1LMKip0dEdykTIqDUr6NEaEDkYO+Fuh2zglarw=; b=w35SSodWBpRCmBRpuHMjdivbsLJlZ06TqwoZjaCMiFH4sTY1ZA5bbJUGJRHSD5OA98 wnwQBQXVZH3b6Rtgs+TOkMTocy8CTjx2ODQikDtMInxRdHoNDFiFZrbCIHaanElL85So nDlGzigKA420FM+MeAHuB19WeHWEWOj+N/tIAPffw8YhsM1N3TQzaTX7zCd4wmzM9w32 HwECxG63lA5W96LtCOEP8h54dTBErINaZVxxOtLI/ibqlBymbzuvN0D1GitYena7uKRp A/t/R6zGqxQT43UPU+b86jyVzI9Stsou5p8TD4KoSxUl3+BIRhgcY1bXLAZ29QxZjAR5 Y/kg== 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=FNQ0C1LMKip0dEdykTIqDUr6NEaEDkYO+Fuh2zglarw=; b=FzynZpJlBw0c8y/1amK4pIjtX8R8lr8j88/1sY0lS1HsFrO1cskjebvQmHrVsxnUH+ rx8N0T9VGE5Maho2TjtV1bZ/XU/NHROQT1hNkAU533tcID48IHmgR0o8f9LIjFsZczWE 3ajldYWGOBly3K5YkpweaEzwoJtd6NX4ljxcDamBGNdlz0QgMGXF3/nLlyRNxcmfofZT QBJbsku33L7uUD5h8rnriPzJQ6xTsxJ8WJOOLRzHAUqLGCqHnHgk4TV3j8etMkDIOro1 TwdHZPcScj075EHA409uumxgmnNGxTBjK3uNYECriqWGqXo2z6ZaWQJI2s4xtVRgj6mq +JHA== X-Gm-Message-State: AOUpUlE9p63f4o81j7pjM/Ax2J3lj0L/TITZ8qy9jf38qFP2ZSg1MEa6 LKiQ1gzgr5J4QSzpdfnbDr0gQsy36q0JfQ== X-Google-Smtp-Source: AA+uWPxvbkSk788c1s9K1k6gxVMofZA9i6tl30G431ekkSiiTnVN8deCUgkDZQdtVqR4daT4IuD0RA== X-Received: by 2002:a24:be8f:: with SMTP id i137-v6mr19844264itf.61.1534367598942; Wed, 15 Aug 2018 14:13:18 -0700 (PDT) From: dana Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: [PATCH] Completion: Use -B+ in _du Message-Id: <97613F9D-B811-41FC-8F13-AA07C2B3C892@dana.is> Date: Wed, 15 Aug 2018 16:13:16 -0500 To: Zsh hackers list X-Mailer: Apple Mail (2.3445.6.18) Just adding + to the -B spec(s) for du. In case this seems pedantic: The lack of + causes really irritating = behaviour when completing arguments after manually entering the +-less option and = its argument as one word, as in the following case: % du -BM /some/incomplete/path/ completing size (bytes): A quick search of the other completion functions shows 219 matching = /-\w\[.*\]:/ and 67 matching /-\w,--[\w-]+=3D/. Probably not *all* of those are = problematic, but i bet most of them are. I'll try to go through and fix them all (or = at least the ones i'm most familiar with) some other time. (Unless it's possible to fix it at a lower level? It seems like = _arguments could be made to handle this mis-spec more gracefully, as long as it hasn't = been called with -w/-W. Maybe that's too 'magic' though) dana diff --git a/Completion/Unix/Command/_du b/Completion/Unix/Command/_du index e812b635e..711f43471 100644 --- a/Completion/Unix/Command/_du +++ b/Completion/Unix/Command/_du @@ -6,7 +6,7 @@ if _pick_variant gnu=3DFree\ Soft unix --version = /dummy/no-such-file; then _arguments -s \ '(-a --all -s --summarize)'{-a,--all}'[write counts for all files]' = \ '--apparent-size[print apparent sizes rather than disc usage]' \ - '(-B --block-size -k)'{-B,--block-size=3D}'[specify block = size]:size (bytes)' \ + '(-B --block-size -k)'{-B+,--block-size=3D}'[specify block = size]:size (bytes)' \ '(-B --block-size -k --apparent-size -b = --bytes)'{-b,--bytes}'[equivalent to --apparent-size --block-size=3D1]' = \ '(-c --total)'{-c,--total}'[produce a grand total]' \ '(-H -D --dereference-args -L --dereference -P = --no-dereference)'{-H,-D,--dereference-args}'[dereference arguments that = are symlinks]' \ @@ -64,7 +64,7 @@ else 'netbsd*' '-i[output inode usage instead of blocks]' \ '(darwin*|freebsd*|netbsd*|solaris2.<11->)' '(-h -k -g -B)-m[use = block size of 1M-byte]' \ '(darwin|freebsd<8->.|netbsd)*' '(-h -k -m -B)-g[use block size of = 1G-byte]' \ - 'freebsd*' '(-h -k -m -g)-B[block size]:block size (bytes)' \ + 'freebsd*' '(-h -k -m -g)-B+[block size]:block size (bytes)' \ '(darwin|*bsd|dragonfly)*' '-c[display grand total]' \ 'freebsd*' '-l[count sizes many times if hard linked]' \ '(freebsd|netbsd)*' '-n[ignore files and directories with nodump = flag set]' \