__fish_man_page: don't try tokens with slashes as subcommands

man-db's man 2.7 as shipped in OpenSUSE fails to set a non-zero
exit code when invoked like "man ls-some/dir". This means
that we fail to display the man page if the commandline is
"ls some/dir". Work around this by never treating tokens
with slashes as subcommand.
This commit is contained in:
Johannes Altmanninger 2022-05-13 20:39:54 +02:00
parent bb325e497a
commit 8df5547f2d

View File

@ -23,6 +23,7 @@ function __fish_man_page
# the best we can do is to *try* the man page, and assume that `man` will return false if it fails.
# See #7863.
if set -q args[2]
and not string match -q -- '*/*' $args[2]
and man "$maincmd-$args[2]" &>/dev/null
man "$maincmd-$args[2]"
else