zsh-workers
 help / color / mirror / code / Atom feed
From: Jun T <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: [PATCH] _tar: improve completion of long options
Date: Wed, 18 Sep 2019 18:34:57 +0900	[thread overview]
Message-ID: <BA72AA66-3FA4-4A39-B77F-F84457A2F8BA@kba.biglobe.ne.jp> (raw)

_tar does not complete long options in many cases, for example:

tar t --<TAB>
tar tf a.tar --<TAB>
tar -t -f a.tar --<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 --<TAB>


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' \



                 reply	other threads:[~2019-09-18  9:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BA72AA66-3FA4-4A39-B77F-F84457A2F8BA@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).