[Bug 290911] man(1) does not support "-l" option, causing portability issues

[email protected] Sun, 09 Nov 2025 11:15:58 +0000
Newsgroups gmane.os.freebsd.devel.standards
Message-ID <[email protected]/bugzilla/>
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290911

            Bug ID: 290911
           Summary: man(1) does not support "-l" option, causing
                    portability issues
           Product: Base System
           Version: 14.3-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: standards
          Assignee: [email protected]
          Reporter: [email protected]

As reported in https://github.com/fish-shell/fish-shell/issues/12037, the
following command

    man /etc/os-release

no longer works on OpenBSD 7.8 because, as noted in their changelog:

> For better consistency with POSIX and traditional UNIX and BSD man,
> if the -l option is not specified, never interpret "name" command line
> arguments as absolute or relative path names, not even for arguments
> that contain a slash and that do not resolve to a manual page name.

So the suggested alternative is to use

        man -l /etc/os-release

Unfortunately, the -l option is not yet supported by FreeBSD's "man" command.

I think we should add this, to make it easy for users to point "man" at an
absolute path.

For now we're planning to use this workaround, which is not ideal because
it invokes man twice:

if man -l "$file" >/dev/null 2>&1; then
    command man -l "$file"
else
    # Work around FreeBSD/macOS
    command man "$file"
fi

Many users (across all OSs) will be running this workaround,
but I hope the workaround will not cause real problems.
So I labeled this "affects some users".

(Yes, this is a fish idiosyncracy -- they use man to render temporarily
materialized files;
if I could go back in time I'd ask fish to install man pages in the correct
location.)

-- 
You are receiving this mail because:
You are the assignee for the bug.