diff options
author | Clint Adams <clint@users.sourceforge.net> | 2006-06-24 19:28:55 +0000 |
---|---|---|
committer | Clint Adams <clint@users.sourceforge.net> | 2006-06-24 19:28:55 +0000 |
commit | fdff42eaa70f115104d3e4269593ed553fa32659 (patch) | |
tree | 83eaf39726ab293acd1001de0436f45cede356d6 | |
parent | a940c3648790aaf115068d8b2a4e239b01cac6a6 (diff) | |
download | zsh-fdff42eaa70f115104d3e4269593ed553fa32659.tar.gz zsh-fdff42eaa70f115104d3e4269593ed553fa32659.tar.xz zsh-fdff42eaa70f115104d3e4269593ed553fa32659.zip |
22511: complete compressed archive filenames for GNU tar even when a compression
option is not specified.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | Completion/Unix/Command/_tar | 2 | ||||
-rw-r--r-- | Completion/Unix/Type/_tar_archive | 2 |
3 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog index 36ca5762a..c96ac8dfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-06-24 Clint Adams <clint@zsh.org> + + * 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 <pws@csr.com> * 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 |