From 7fc1fa88a89b335244f89cc8b74dfca67255faed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ville=20Skytt=C3=A4?= Date: Mon, 19 Apr 2010 21:36:47 +0300 Subject: [PATCH] Fix handling of short xz options. Was broken in 8f42adfa8d5e9fbbba9566d1b76d9f89667e6d98 --- contrib/xz | 2 +- test/fixtures/xz/a/b | 0 test/fixtures/xz/bashcomp.lzma | 0 test/fixtures/xz/bashcomp.tar | 0 test/fixtures/xz/bashcomp.tar.xz | Bin 0 -> 196 bytes test/fixtures/xz/bashcomp.tlz | 0 test/fixtures/xz/bashcomp.xz | 0 test/lib/completions/xz.exp | 13 +++++++++++++ 8 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/xz/a/b create mode 100644 test/fixtures/xz/bashcomp.lzma create mode 100644 test/fixtures/xz/bashcomp.tar create mode 100644 test/fixtures/xz/bashcomp.tar.xz create mode 100644 test/fixtures/xz/bashcomp.tlz create mode 100644 test/fixtures/xz/bashcomp.xz diff --git a/contrib/xz b/contrib/xz index 8f02b1df..3a543f33 100644 --- a/contrib/xz +++ b/contrib/xz @@ -23,7 +23,7 @@ _xz() local xspec="*.@(xz|lzma|txz|tlz)" case $prev in - --decompress|--list|--test|!(-*)[dlt]*) + --decompress|--list|--test|-!(-*)[dlt]*) xspec="!"$xspec ;; --files|--files0) diff --git a/test/fixtures/xz/a/b b/test/fixtures/xz/a/b new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/xz/bashcomp.lzma b/test/fixtures/xz/bashcomp.lzma new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/xz/bashcomp.tar b/test/fixtures/xz/bashcomp.tar new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/xz/bashcomp.tar.xz b/test/fixtures/xz/bashcomp.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..b2274e643656b13b34de30fb05b9af3105ef6410 GIT binary patch literal 196 zcmV;#06YKvH+ooF000E$*0e?f03iVu0001VFXf})C;tF~T>vo{O3f>P)Y_4%Ai}p} zA&$}hiz?N(4>K|UPlVekaSd0b^>j4VoO=U|> zLl%?*CMj~r{K0qsL3>Wa7j}TXIURStAlC>(eB|Pjg`)Bk^ag_FA4#S^aRPL*7dKmb yz$Pk{Qu*=O@u1cK0001R?XB|oZ`8s70iFSXPyhhc61-Tk#Ao{g000001X)_3{ZT#u literal 0 HcmV?d00001 diff --git a/test/fixtures/xz/bashcomp.tlz b/test/fixtures/xz/bashcomp.tlz new file mode 100644 index 00000000..e69de29b diff --git a/test/fixtures/xz/bashcomp.xz b/test/fixtures/xz/bashcomp.xz new file mode 100644 index 00000000..e69de29b diff --git a/test/lib/completions/xz.exp b/test/lib/completions/xz.exp index 474ab24d..820b0689 100644 --- a/test/lib/completions/xz.exp +++ b/test/lib/completions/xz.exp @@ -17,4 +17,17 @@ assert_complete_any "xz " sync_after_int +assert_complete "a/ bashcomp.lzma bashcomp.tar.xz bashcomp.tlz bashcomp.xz" \ + "xz -d fixtures/xz/" + + +sync_after_int + + +assert_complete "a/ bashcomp.tar" "xz fixtures/xz/" + + +sync_after_int + + teardown