From f485169391481bac78afbefaa5ff29254b3125f9 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 30 Apr 2021 19:16:57 +0200 Subject: [PATCH] __fish_apropos: Fix on macOS Because MacOS' apropos is bad and doesn't support the `--` option separator, this apparently spews errors. Because the argument _can't_ start with a `-` (because we add a `^`), we can just remove it. Fixes #7965. --- share/functions/__fish_apropos.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/__fish_apropos.fish b/share/functions/__fish_apropos.fish index 6da05a15d..2714a50a1 100644 --- a/share/functions/__fish_apropos.fish +++ b/share/functions/__fish_apropos.fish @@ -37,7 +37,7 @@ if test $status -eq 0 -a (count $sysver) -eq 3 set age (math (date +%s) - (/usr/bin/stat -f %m $whatis)) end - MANPATH="$dir" apropos -- "^$argv" + MANPATH="$dir" apropos "^$argv" if test $age -ge $max_age test -d "$dir" || mkdir -m 700 -p $dir