version 1.188, 2014/08/30 18:08:10 |
version 1.190, 2014/09/03 05:22:45 |
Line 154 main(int argc, char *argv[]) |
|
Line 154 main(int argc, char *argv[]) |
|
show_usage = 0; |
show_usage = 0; |
outmode = OUTMODE_DEF; |
outmode = OUTMODE_DEF; |
|
|
while (-1 != (c = getopt(argc, argv, "aC:cfI:iklM:m:O:S:s:T:VW:w"))) { |
while (-1 != (c = getopt(argc, argv, "aC:cfhI:iklM:m:O:S:s:T:VW:w"))) { |
switch (c) { |
switch (c) { |
case 'a': |
case 'a': |
outmode = OUTMODE_ALL; |
outmode = OUTMODE_ALL; |
Line 168 main(int argc, char *argv[]) |
|
Line 168 main(int argc, char *argv[]) |
|
case 'f': |
case 'f': |
search.argmode = ARG_WORD; |
search.argmode = ARG_WORD; |
break; |
break; |
|
case 'h': |
|
(void)strlcat(curp.outopts, "synopsis,", BUFSIZ); |
|
outmode = OUTMODE_ALL; |
|
break; |
case 'I': |
case 'I': |
if (strncmp(optarg, "os=", 3)) { |
if (strncmp(optarg, "os=", 3)) { |
fprintf(stderr, |
fprintf(stderr, |
Line 284 main(int argc, char *argv[]) |
|
Line 288 main(int argc, char *argv[]) |
|
mansearch_setup(1); |
mansearch_setup(1); |
if( ! mansearch(&search, &paths, argc, argv, &res, &sz)) |
if( ! mansearch(&search, &paths, argc, argv, &res, &sz)) |
usage(search.argmode); |
usage(search.argmode); |
manpath_free(&paths); |
|
resp = res; |
resp = res; |
|
|
if (sz == 0) { |
if (sz == 0) { |
Line 367 main(int argc, char *argv[]) |
|
Line 370 main(int argc, char *argv[]) |
|
while (argc) { |
while (argc) { |
#if HAVE_SQLITE3 |
#if HAVE_SQLITE3 |
if (resp != NULL) { |
if (resp != NULL) { |
if (resp->form) |
if (resp->form) { |
|
/* For .so only; ignore failure. */ |
|
chdir(paths.paths[resp->ipath]); |
parse(&curp, -1, resp->file, &rc); |
parse(&curp, -1, resp->file, &rc); |
else |
} else |
rc = passthrough(resp->file); |
rc = passthrough(resp->file); |
resp++; |
resp++; |
} else |
} else |
Line 388 main(int argc, char *argv[]) |
|
Line 393 main(int argc, char *argv[]) |
|
#if HAVE_SQLITE3 |
#if HAVE_SQLITE3 |
out: |
out: |
if (search.argmode != ARG_FILE) { |
if (search.argmode != ARG_FILE) { |
|
manpath_free(&paths); |
mansearch_free(res, sz); |
mansearch_free(res, sz); |
mansearch_setup(0); |
mansearch_setup(0); |
} |
} |
Line 412 usage(enum argmode argmode) |
|
Line 418 usage(enum argmode argmode) |
|
|
|
switch (argmode) { |
switch (argmode) { |
case ARG_FILE: |
case ARG_FILE: |
fputs("usage: mandoc [-acfklV] [-Ios=name] " |
fputs("usage: mandoc [-acfhklV] [-Ios=name] " |
"[-mformat] [-Ooption] [-Toutput] [-Wlevel]\n" |
"[-mformat] [-Ooption] [-Toutput] [-Wlevel]\n" |
"\t [file ...]\n", stderr); |
"\t [file ...]\n", stderr); |
break; |
break; |
Line 422 usage(enum argmode argmode) |
|
Line 428 usage(enum argmode argmode) |
|
"\t [section] name ...\n", stderr); |
"\t [section] name ...\n", stderr); |
break; |
break; |
case ARG_WORD: |
case ARG_WORD: |
fputs("usage: whatis [-acfklVw] [-C file] " |
fputs("usage: whatis [-acfhklVw] [-C file] " |
"[-M path] [-m path] [-O outkey] [-S arch]\n" |
"[-M path] [-m path] [-O outkey] [-S arch]\n" |
"\t [-s section] name ...\n", stderr); |
"\t [-s section] name ...\n", stderr); |
break; |
break; |
case ARG_EXPR: |
case ARG_EXPR: |
fputs("usage: apropos [-acfklVw] [-C file] " |
fputs("usage: apropos [-acfhklVw] [-C file] " |
"[-M path] [-m path] [-O outkey] [-S arch]\n" |
"[-M path] [-m path] [-O outkey] [-S arch]\n" |
"\t [-s section] expression ...\n", stderr); |
"\t [-s section] expression ...\n", stderr); |
break; |
break; |