Bug 290911 - man(1) does not support "-l" option, causing portability issues
Summary: man(1) does not support "-l" option, causing portability issues
Status: Closed DUPLICATE of bug 289245
Alias: None
Product: Base System
Classification: Unclassified
Component: standards (show other bugs)
Version: 14.3-STABLE
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-standards (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-11-09 11:15 UTC by Johannes Altmanninger
Modified: 2025-11-10 15:56 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Altmanninger 2025-11-09 11:15:58 UTC
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.)
Comment 1 Johannes Altmanninger 2025-11-09 11:23:43 UTC
> if man -l "$file" >/dev/null 2>&1

FWIW that workaround also needs `MANPAGER=cat WHATISPAGER=cat` to work around
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282414,
else the if-condition might spawn a man pager..
Comment 2 Ed Maste freebsd_committer freebsd_triage 2025-11-10 15:53:51 UTC

*** This bug has been marked as a duplicate of bug 289245 ***
Comment 3 Ed Maste freebsd_committer freebsd_triage 2025-11-10 15:56:47 UTC
-l support is available in upcoming FreeBSD releases (15.0, 14.4). A workaround will be needed for existing releases (14.3, 13.5).