functions/man: Pass "-l" to get man to open a file

Supported by mandoc, man-db and NetBSD man, and mandoc now requires
this.

Fixes #12037
This commit is contained in:
Fabian Boehm
2025-11-08 14:50:10 +01:00
parent d6ed5f843e
commit 8e4fa9aafb

View File

@@ -62,7 +62,8 @@ function man
if not set -q argv[2] && status list-files "man/man1/$argv[1].1" &>/dev/null
set -l basename $argv[1].1
function __fish_man -V basename -a man1
command man $man1/$basename
# mandoc man needs "-l" or it'll refuse to open a file
command man -l $man1/$basename
end
__fish_data_with_directory man/man1 \
(string escape --style=regex -- $basename) __fish_man