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 00000000..b2274e64 Binary files /dev/null and b/test/fixtures/xz/bashcomp.tar.xz differ 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