summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-04-18 16:01:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-04-18 16:01:20 +0000
commit0a01aecfc2a95af2e7c4a4cba60c688fed82d9d4 (patch)
tree966d1dda1162902a634d02dd2f782262ca820b38
parent4df1bc6f95fa256c0355afc2d808ed94c63fe442 (diff)
downloadmandoc-0a01aecfc2a95af2e7c4a4cba60c688fed82d9d4.tar.gz
Now that global -i is gone, pass -i through to the apropos(1)
expression parser, such that "apropos -i 'Nm~dump\>'" finds kdump(1) and WCOREDUMP(2) and you don't need to type the counter-intuitive "apropos -- -i 'Nm~dump\>'".
-rw-r--r--main.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/main.c b/main.c
index 6fc3d4ad..696c556f 100644
--- a/main.c
+++ b/main.c
@@ -193,8 +193,12 @@ main(int argc, char *argv[])
show_usage = 0;
outmode = OUTMODE_DEF;
- while (-1 != (c = getopt(argc, argv,
- "aC:cfhI:iK:klM:m:O:S:s:T:VW:w"))) {
+ while ((c = getopt(argc, argv,
+ "aC:cfhI:iK:klM:m:O:S:s:T:VW:w")) != -1) {
+ if (c == 'i' && search.argmode == ARG_EXPR) {
+ optind--;
+ break;
+ }
switch (c) {
case 'a':
outmode = OUTMODE_ALL;