Revert "completions/unzip: Stop filtering suffixes"

This reverts commit 46068cd257.
This commit is contained in:
Johannes Altmanninger 2020-12-13 07:28:53 +01:00
parent e43913a547
commit d18e1c7bca

View file

@ -26,7 +26,25 @@ complete -c unzip -s M -d "pipe through `more` pager"
# Debian version of unzip
if unzip -v 2>/dev/null | string match -eq Debian
# Files after the first token are either files to include or exclude from the operation
# the first non-switch argument should be the zipfile
complete -c unzip -n __fish_is_first_token -xa '(
__fish_complete_suffix .zip
__fish_complete_suffix .jar
__fish_complete_suffix .aar
)'
# Files thereafter are either files to include or exclude from the operation
set -l zipfile
complete -c unzip -n 'not __fish_is_first_token' -xa '(unzip -l (eval set zipfile (__fish_first_token); echo $zipfile) | string replace -r --filter ".*:\S+\s+(.*)" "\$1")'
else
# all tokens should be zip files
complete -c unzip -xa '(
__fish_complete_suffix .zip
__fish_complete_suffix .jar
__fish_complete_suffix .aar
)'
end