From 0cfdc9055132f2842007da95bf105a8d122141c3 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sun, 18 Jun 2023 21:27:29 +0200 Subject: [PATCH] completions/unzip: Dangit FreeBSD No "--help" and the man page doesn't mention "-h". --- share/completions/unzip.fish | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/share/completions/unzip.fish b/share/completions/unzip.fish index e258294c5..68864d1a1 100644 --- a/share/completions/unzip.fish +++ b/share/completions/unzip.fish @@ -23,11 +23,12 @@ complete -c unzip -s X -d "restore UID/GID info" complete -c unzip -s V -d "retain VMS version numbers" complete -c unzip -s K -d "keep setuid/setgid/tacky permissions" complete -c unzip -s M -d "pipe through `more` pager" -# Some distro has -O and -I, some hasn't. -if unzip --help | string match -rq -- -O +# Some distros have -O and -I, some don't. +# Even "-h" might not be available. +if unzip -h 2>/dev/null | string match -rq -- -O complete -c unzip -s O -d "specify a character encoding for DOS, Windows and OS/2 archives" -x -a "(__fish_print_encodings)" end -if unzip --help | string match -rq -- -I +if unzip -h 2>/dev/null | string match -rq -- -I complete -c unzip -s I -d "specify a character encoding for UNIX and other archives" -x -a "(__fish_print_encodings)" end