mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
Revert "completions/unzip: Stop filtering suffixes"
This reverts commit 46068cd257
.
This commit is contained in:
parent
e43913a547
commit
d18e1c7bca
1 changed files with 19 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue