__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.
This commit is contained in:
Fabian Homborg
2021-04-30 19:16:57 +02:00
parent 2cea5b8eb1
commit f485169391

View File

@@ -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