__fish_apropos: Also add "--" separator

This actually *worked* in my tests which confuses me.

It really shouldn't, `apropos -foo` will complain about "-o" not being
a valid option.

It should be `apropos -- -foo`.

Now, of course there are awful apropos implementations, so let's see
if someone complains
This commit is contained in:
Fabian Homborg 2021-03-10 07:22:17 +01:00
parent d2fc1c47ac
commit dfebfcf376

View File

@ -30,13 +30,13 @@ function __fish_apropos
set age (math (date +%s) - (/usr/bin/stat -f %m $db))
end
MANPATH="$cache" apropos $argv
MANPATH="$cache" apropos -- $argv
if test $age -ge $max_age
mkdir -m 700 -p $cache
/usr/libexec/makewhatis -o $db (man --path | string split :) >/dev/null 2>&1 </dev/null &
end
else
apropos $argv
apropos -- $argv
end
end