summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-08-30 18:08:10 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-08-30 18:08:10 +0000
commit24387bf29bff146c16b4c293b9c384cb99730d62 (patch)
treeb30029cd4ba65d447185793fa6821d81fc364d6e /main.c
parent3c2c418ed925503520d69d3b17650956b2324143 (diff)
downloadmandoc-24387bf29bff146c16b4c293b9c384cb99730d62.tar.gz
Introduce a man(1) -l option as an alias for mandoc -a.
Basically, this does the same as man -l in Linux man-db. The point is that now all functionality of the combined tool is reachable from the man(1) command name: apropos = man -k, whatis = man -f, mandoc = man -cl. Originally suggested by Carsten dot Kunze at arcor dot de, current maintainer of the Heirloom Documentation Tools. While here, add various missing information to the usage() and to the manuals.
Diffstat (limited to 'main.c')
-rw-r--r--main.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/main.c b/main.c
index 5b473292..a628cd86 100644
--- a/main.c
+++ b/main.c
@@ -154,7 +154,7 @@ main(int argc, char *argv[])
show_usage = 0;
outmode = OUTMODE_DEF;
- while (-1 != (c = getopt(argc, argv, "aC:cfI:ikM:m:O:S:s:T:VW:w"))) {
+ while (-1 != (c = getopt(argc, argv, "aC:cfI:iklM:m:O:S:s:T:VW:w"))) {
switch (c) {
case 'a':
outmode = OUTMODE_ALL;
@@ -189,6 +189,10 @@ main(int argc, char *argv[])
case 'k':
search.argmode = ARG_EXPR;
break;
+ case 'l':
+ search.argmode = ARG_FILE;
+ outmode = OUTMODE_ALL;
+ break;
case 'M':
defpaths = optarg;
break;
@@ -408,22 +412,23 @@ usage(enum argmode argmode)
switch (argmode) {
case ARG_FILE:
- fputs("usage: mandoc [-V] [-Ios=name] [-mformat]"
- " [-Ooption] [-Toutput] [-Wlevel]\n"
+ fputs("usage: mandoc [-acfklV] [-Ios=name] "
+ "[-mformat] [-Ooption] [-Toutput] [-Wlevel]\n"
"\t [file ...]\n", stderr);
break;
case ARG_NAME:
- fputs("usage: man [-acfhkVw] [-C file] "
+ fputs("usage: man [-acfhklVw] [-C file] "
"[-M path] [-m path] [-S arch] [-s section]\n"
"\t [section] name ...\n", stderr);
break;
case ARG_WORD:
- fputs("usage: whatis [-V] [-C file] [-M path] [-m path] "
- "[-S arch] [-s section] name ...\n", stderr);
+ fputs("usage: whatis [-acfklVw] [-C file] "
+ "[-M path] [-m path] [-O outkey] [-S arch]\n"
+ "\t [-s section] name ...\n", stderr);
break;
case ARG_EXPR:
- fputs("usage: apropos [-V] [-C file] [-M path] [-m path] "
- "[-O outkey] [-S arch]\n"
+ fputs("usage: apropos [-acfklVw] [-C file] "
+ "[-M path] [-m path] [-O outkey] [-S arch]\n"
"\t [-s section] expression ...\n", stderr);
break;
}