moreman: Man Pages for Commands without Man Pages
This program generates man pages for command line tools which do not come with
proper separate man pages. For these tools man cannot display manual
information, moreman however uses the command's help string (usually
displayed via the command line option --help) and assembles from this a "man
page".
Overview
moreman is designed as a drop-in replacement for man. Apart from
very few options moreman passes all arguments through to the man command it
eventually calls. If moreman is called with a tool name for which a normal
man page exists, it just passes the name through to man; if no normal man
page exists, moreman assembles the man page in the described manner and then
calls man for final formatting.
My personal use is inside Emacs: Emacs has the great feature of Man
Page Lookup: It displays each man page in its own buffer/frame, so
that you easily can view the documentation to a command while using the command
in a shell buffer in another window or frame. - And with moreman this extends
to all commands which provide some meaningful documentation via their help
message even if they do not have a real man page.
A Word of Warning
moreman works by calling the command it wants to create the man page for with
the help option - normally --help. This can be dangerous if the command
does not expect --help to display the help message.
Installation
Requirements
At least Python 3.5 (legacy Python 2.7 might work as well) plus the argh
package.
Install
The tool is pip-installable: pip install moreman For the intended command
line use though I recommend installation via pipx:
pipx install moreman
Usage
Test whether everything is set up correctly by invoking moreman's help
message:
$ moreman --help
This should give you something like
usage: moreman [-h] [-v] [--man-cmd MAN_CMD] [-g HELP_ARG] [-f]
name [name ...]
positional arguments:
name name of the command or man page
optional arguments:
-h, --help show this help message and exit
-v, --verbose verbose output ('-v' shadows man's -v for version!)
(default: False)
--man-cmd MAN_CMD man command to be used (default: 'man')
-g HELP_ARG, --help-arg HELP_ARG
help argument to the command used to generate help
document (default: '--help')
-f, --force force to generate man page from --help even if man
page exists ('-f' shadows man's -f for whatis lookup!)
(default: False)
All other options are passed through to the 'man' command.
Now try to list the same info as a "man page":
$ moreman moreman
Voila! This should look like a proper man page - many man page viewers are able to recognise this format.1
Hooking up to Emacs
In order use moreman in Emacs, customise the Emacs variable manual-program
(which is in the man customisation group). After checking that you can
access moreman from your shell prompt set manual-program to moremanand
everything should work fine.
Help for sub commands
Some tools provide extensive help and they split it over the help messages of
multiple sub commands. moreman can utilise these sub command help messages via
the --help-arg option.
Update September 2019: Some pip installations do install a man page - in that case this example is obsolete.
For example pip --help lists only some general options and pip's sub
commands; detailed info about, say, the install sub command is displayed only
by pip install --help.
But issue
moreman --help-arg="install --help" pip
and you get a "man page" for the install subcommand of pip.
This works in Emacs too: After M-x man enter at the prompt
--help-arg="install --help" pip.2
Miscellaneous
If you have difficulties, open an GitHub issue for your problem. If you made enhancements, please create a pull request.
Also note, this project uses another little module I wrote: ArghEx: Extensions for Argh
Metadata
Release files for moreman 0.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| moreman-0.3.3.tar.gz | 19.9 kB | Without provenance | Details for moreman-0.3.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| moreman-0.3.3-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for moreman-0.3.3-py2.py3-none-any.whl |
Total release size: 39.5 kB
Release files / moreman-0.3.3.tar.gz
| Download URL | moreman-0.3.3.tar.gz |
|---|---|
| Size | 19.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af0bcdba8c23bc4f0d5f305c6db80e46c1bbfe16ff36e59034f31af6794ab635
|
|
BLAKE2b-256 checksum How to use checksums |
b78f0a43f800519c9c202567701a99231d41aaac6912271d74b958b7a7beaae9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Release files / moreman-0.3.3-py2.py3-none-any.whl
| Download URL | moreman-0.3.3-py2.py3-none-any.whl |
|---|---|
| Size | 19.5 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
850a2aa4628b575a2e5e4e42530af968873f43af64969ebb06b77f6b0906b924
|
|
BLAKE2b-256 checksum How to use checksums |
b39b2d3b6bb0fc68337067707917d2c6297a6cdcb733cd4c69fa9f6a1e907490
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.0 CPython/3.12.3
|
Security for moreman 0.3.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.