diff options
author | Oliver Kiddle <opk@users.sourceforge.net> | 2003-02-28 13:50:44 +0000 |
---|---|---|
committer | Oliver Kiddle <opk@users.sourceforge.net> | 2003-02-28 13:50:44 +0000 |
commit | 79d0de7c3ad8626d507b50176a80cf7ecb6f3996 (patch) | |
tree | 7009741bcfcf45c42ddea3be5a48807bc10f2ea9 /Completion/Unix/Type/_tar_archive | |
parent | 937e1b9f795e5fa3d605ae908ad96757e38014f7 (diff) | |
download | zsh-79d0de7c3ad8626d507b50176a80cf7ecb6f3996.tar.gz zsh-79d0de7c3ad8626d507b50176a80cf7ecb6f3996.tar.xz zsh-79d0de7c3ad8626d507b50176a80cf7ecb6f3996.zip |
merge changes from 4.1
Diffstat (limited to 'Completion/Unix/Type/_tar_archive')
-rw-r--r-- | Completion/Unix/Type/_tar_archive | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Completion/Unix/Type/_tar_archive b/Completion/Unix/Type/_tar_archive new file mode 100644 index 000000000..c5ab0e9fc --- /dev/null +++ b/Completion/Unix/Type/_tar_archive @@ -0,0 +1,26 @@ +#autoload + +# This is used to generate filenames usable as a tar archive. This may +# get one argument, a collection of tar option characters that may be +# used to find out what kind of filename is needed. If no argument is +# given but the parameter `_tar_cmd' is set, that is used. +# If your version of `tar' supports this you may want to complete +# things like `host:file' or `user@host:file' here. + +local expl + +[[ $# -eq 0 && $+_tar_cmd -ne 0 ]] && set "$_tar_cmd" + +_description files expl 'archive file' + +if [[ "$1" = *[urtx]* ]]; then + if [[ "$1" = *[zZ]* ]]; then + _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|tgz)' + elif [[ "$1" = *[Ijy]* ]]; then + _files "$expl[@]" -g '*.(tar|TAR).bz2' + else + _files "$expl[@]" -g '*.(tar|TAR)' + fi +else + _files "$expl[@]" +fi |