From fdff42eaa70f115104d3e4269593ed553fa32659 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Sat, 24 Jun 2006 19:28:55 +0000 Subject: 22511: complete compressed archive filenames for GNU tar even when a compression option is not specified. --- ChangeLog | 7 +++++++ Completion/Unix/Command/_tar | 2 ++ Completion/Unix/Type/_tar_archive | 2 ++ 3 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 36ca5762a..c96ac8dfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-24 Clint Adams + + * 22511: Completion/Unix/Command/_tar, + Completion/Unix/Type/_tar_archive: complete compressed archive + filenames for GNU tar even when a compression option is not + specified. + 2006-06-19 Peter Stephenson * 22501: configure.ac: reduce default maximum function depth diff --git a/Completion/Unix/Command/_tar b/Completion/Unix/Command/_tar index 3e3b3fc51..b3a590d72 100644 --- a/Completion/Unix/Command/_tar +++ b/Completion/Unix/Command/_tar @@ -21,6 +21,8 @@ local _tar_cmd tf tmp tmpb del index # from some of the possible long options, and from the second word if # that does not start with a hyphen. +_pick_variant gnu=GNU unix --version + tmp=("${(@M)words:#-[^-]*}") _tar_cmd="${(j::)tmp#-}" diff --git a/Completion/Unix/Type/_tar_archive b/Completion/Unix/Type/_tar_archive index 95a864cee..eceaea875 100644 --- a/Completion/Unix/Type/_tar_archive +++ b/Completion/Unix/Type/_tar_archive @@ -18,6 +18,8 @@ if [[ "$1" = *[urtx]* ]]; then _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|tgz)(-.)' elif [[ "$1" = *[Ijy]* ]]; then _files "$expl[@]" -g '*.(tar|TAR).bz2(-.)' + elif [[ "$_cmd_variant[$service]" == gnu ]]; then + _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z|bz2)|tgz)(-.)' else _files "$expl[@]" -g '*.(tar|TAR)(-.)' fi -- cgit 1.4.1