Project

General

Profile

Feature #11477

`man` could strcasecmp the section name for `man <name>.<section>`

Added by Robert Mustacchi over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Category:
cmd - userland programs
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Today, most manual page sections are capitalized. This means that when man says to read something like shutdown(1M), one might think they could use man shutdown.1M. While man -s 1M shutdown does work. We've had a number of users stumble over this, so I decided to try and handle this case.

I've gone through and implemented this by saying that if we have a . in the file name after we've stripped off any compression suffix, that we make another copy of that string and transform this to an upper case version which we then do as an additional test. Note, this doesn't normalize the user's requested case, mainly that which was asked for in the file name. This means that if the user has asked for something like uio.3HEad, it won't work.

To test this I ran through a couple of variations here including the aforementioned shutdown.1M case. These include a number of variants on using -s, -a, and capitalizing the section name. These include:

$ ./man -s 9S uio
$ ./man -s 9s uio
$ ./man -s 9s uio.9s
$ ./man -s 9s uio.9S
$ ./man  uio.9S
$ ./man  uio   
$ ./man -a  uio$ ./man -a  uio.9S

Also available in: Atom PDF