mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 20:33:08 +00:00
Fix unzip completions for non Info-ZIP versions
macOS and (AFAICT) most Linux distributions ship with the Info-ZIP version of unzip, which has the `unzip -h` flag; but other implementations of unzip do not necessarily have it (i.e. FreeBSD). `unzip` under FreeBSD does not support `unzip -h`. Under both Linux and FreeBSD, `unzip -v` presents the list of options, though. Using this instead of `unzip -h` to detect the Debian-patched version of the Info-ZIP unzip program.
This commit is contained in:
parent
8de5af5f9e
commit
f6a1bc1489
1 changed files with 1 additions and 1 deletions
|
@ -25,7 +25,7 @@ complete -c unzip -s K -d "keep setuid/setgid/tacky permissions"
|
|||
complete -c unzip -s M -d "pipe through `more` pager"
|
||||
|
||||
# Debian version of unzip
|
||||
if unzip -h | string match -eq Debian
|
||||
if unzip -v 2>/dev/null | string match -eq Debian
|
||||
|
||||
# the first non-switch argument should be the zipfile
|
||||
complete -c unzip -n '__fish_is_first_token' -xa '(__fish_complete_suffix .zip)'
|
||||
|
|
Loading…
Reference in a new issue