about summary refs log tree commit diff
path: root/Completion/User/_tar_archive
diff options
context:
space:
mode:
Diffstat (limited to 'Completion/User/_tar_archive')
-rw-r--r--Completion/User/_tar_archive12
1 files changed, 9 insertions, 3 deletions
diff --git a/Completion/User/_tar_archive b/Completion/User/_tar_archive
index 58e436c4d..e5a754e93 100644
--- a/Completion/User/_tar_archive
+++ b/Completion/User/_tar_archive
@@ -7,14 +7,20 @@
 # 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" = *[tx]* ]]; then
   if [[ "$1" = *[zZ]* ]]; then
-    _files -g '*.((tar|TAR).(gz|GZ|Z)|.tgz)'
+    _files "$expl[@]" -g '*.((tar|TAR).(gz|GZ|Z)|tgz)'
+  elif [[ "$1" = *[Ijy]* ]]; then
+    _files "$expl[@]" -g '*.(tar|TAR).bz2'
   else
-    _files -g '*.(tar|TAR)'
+    _files "$expl[@]" -g '*.(tar|TAR)'
   fi
 else
-  _files
+  _files "$expl[@]"
 fi