help / color / Atom feed
* [PATCH] _tar: improve completion of long options
@ 2019-09-18  9:34 Jun T
  0 siblings, 0 replies; only message in thread
From: Jun T @ 2019-09-18  9:34 UTC (permalink / raw)
  To: zsh-workers

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-18  9:34 [PATCH] _tar: improve completion of long options Jun T


Archives are clonable: git clone --mirror http://inbox.vuxu.org/zsh-workers

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git