Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] _tar: improve completion of long options



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




Messages sorted by: Reverse Date, Date, Thread, Author