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=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 a1ce93a5 for ; Wed, 18 Sep 2019 09:35:38 +0000 (UTC) Received: (qmail 4780 invoked by alias); 18 Sep 2019 09:35:33 -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: 44768 Received: (qmail 29160 invoked by uid 1010); 18 Sep 2019 09:35:33 -0000 X-Qmail-Scanner-Diagnostics: from rcpt-expgw.biglobe.ne.jp by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.101.2/25573. spamassassin: 3.4.2. Clear:RC:0(133.208.98.1):SA:0(-2.6/5.0):. Processed in 1.025228 secs); 18 Sep 2019 09:35:33 -0000 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.98.1 as permitted sender) X-Biglobe-Sender: From: Jun T Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Subject: [PATCH] _tar: improve completion of long options Message-Id: Date: Wed, 18 Sep 2019 18:34:57 +0900 To: zsh-workers@zsh.org X-Mailer: Apple Mail (2.3445.104.11) X-Biglobe-Spnum: 48138 _tar does not complete long options in many cases, for example: tar t -- tar tf a.tar -- tar -t -f a.tar -- In the following workaround, the spec '*: : true' tells _arguments that 't', 'tf' or 'a.tar' in the examples above are legal and do not stop completion at these "arguments". The effect of '-f+:' is not to complete long options for tar -f -- diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar index 727fbd6b5..f9901c0c9 100644 --- a/Completion/Unix/Command/_tar +++ b/Completion/Unix/Command/_tar @@ -99,7 +99,7 @@ if [[ "$PREFIX" = --* ]]; then # ...long options after `--'. - _arguments -- -l '--owner=*:user:_users' \ + _arguments '-f+:' '-C+:' '*: : true' -- -l '--owner=*:user:_users' \ '--group=*:group:_groups' \ '--atime-preserve*::method:(replace system)' \ '--*-script=NAME:script file:_files' \