`man` could strcasecmp the section name for `man <name>.<section>`
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
Updated by Electric Monk about 2 years ago
- Status changed from New to Closed
- % Done changed from 90 to 100
commit 54f916c8df8cc80d841868fd67146743b1d266dc Author: Robert Mustacchi <email@example.com> Date: 2019-07-19T16:56:37.000Z 11477 `man` could strcasecmp the section name for `man <name>.<section>` Reviewed by: Richard Lowe <firstname.lastname@example.org> Reviewed by: Alexander Pyhalov <email@example.com> Reviewed by: Toomas Soome <firstname.lastname@example.org> Reviewed by: Andy Fiddaman <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>