/usr/bin/mandoc: invalid option -- '-'
/usr/bin/mandoc: invalid option -- 'e'
/usr/bin/mandoc: invalid option -- 'p'
usage: mandoc [-ac] [-I os=name] [-K encoding] [-mdoc | -man] [-O options]
[-T output] [-W level] [file ...]
Options (8)
| Option | Description | Source |
|---|
-a | If the standard output is a terminal device and -c is not specified, use less(1) to paginate the output, just like man(1) would. | man |
-c | Copy the formatted manual pages to the standard output without using less(1) to paginate them. | man |
-I os=name | Override the default operating system name for the mdoc(7) Os and for the man(7) TH macro. | man |
-K encoding | Specify the input encoding. | man |
-mdoc, -man | With -mdoc, all input files are interpreted as mdoc(7). | man |
-O options | Comma-separated output options. | man |
-T output | Select the output format. | man |
-W level | Specify the minimum message level to be reported on the standard error output and to affect the exit status. | man |
Exit status (7) from the manual page
0 | No base system convention violations, style suggestions, warnings, or errors occurred, or those that did were ignored because they were lower than the requested level. |
1 | At least one base system convention violation or style suggestion occurred, but no warning or error, and -W base or -W style was specified. |
2 | At least one warning occurred, but no error, and -W warning or a lower level was requested. |
3 | At least one parsing error occurred, but no unsupported feature was encountered, and -W error or a lower level was requested. |
4 | At least one unsupported feature was encountered, and -W unsupp or a lower level was requested. |
5 | Invalid command line arguments were specified. |
6 | An operating system error occurred, for example exhaustion of memory, file descriptors, or process table entries. |
Examples (5) from the manual page, untested
mandoc -l mandoc.1 man.1 apropos.1 makewhatis.8
To page manuals to the terminal:mandoc -T html -O style=/usr/share/misc/mandoc.css mdoc.7 > mdoc.7.html
To produce HTML manuals with /usr/share/misc/mandoc.css as the style-sheet:mandoc -T lint find /usr/src -name .[1-9]
To check over a large set of manuals:mandoc -T ps -O paper=a4 mdoc.7 man.7 > manuals.ps
To produce a series of PostScript manuals for A4 paper:mandoc -T man foo.mdoc > foo.man
Convert a modern mdoc(7) manual to the older man(7) format, for use on systems lacking an mdoc(7) parser:
Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.