zsh-workers
 help / color / mirror / code / 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, other threads:[~2019-09-18  9:35 UTC | newest]

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

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).