summaryrefslogtreecommitdiffstats
path: root/apropos.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2011-11-13 11:10:27 +0000
committerIngo Schwarze <schwarze@openbsd.org>2011-11-13 11:10:27 +0000
commite1e948c76eb5817bac9e6e4dbbc30fe62e010f62 (patch)
tree5fac405ee4a36b94824d008fc8fb1ffc50aeca73 /apropos.c
parent3b6c23580b17850eb580cf7bf023bd9f04563ca0 (diff)
downloadmandoc-e1e948c76eb5817bac9e6e4dbbc30fe62e010f62.tar.gz
Rewrite the expression parser for a more concise syntax:
apropos [search_type[,...]=]substring apropos search_type[,...][,i]~regex ... and expression evaluation must take the search type into account. This allows to: * drop the global -I option and * drop the enum match, just using a boolean int. "go ahead" kristaps@
Diffstat (limited to 'apropos.c')
-rw-r--r--apropos.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/apropos.c b/apropos.c
index 6f731c4a..0e3ac42f 100644
--- a/apropos.c
+++ b/apropos.c
@@ -33,7 +33,7 @@ static char *progname;
int
main(int argc, char *argv[])
{
- int ch, cs;
+ int ch;
struct opts opts;
struct expr *e;
extern int optind;
@@ -47,9 +47,7 @@ main(int argc, char *argv[])
else
++progname;
- cs = 0;
-
- while (-1 != (ch = getopt(argc, argv, "S:s:I")))
+ while (-1 != (ch = getopt(argc, argv, "S:s:")))
switch (ch) {
case ('S'):
opts.arch = optarg;
@@ -57,9 +55,6 @@ main(int argc, char *argv[])
case ('s'):
opts.cat = optarg;
break;
- case ('I'):
- cs = 1;
- break;
default:
usage();
return(EXIT_FAILURE);
@@ -71,7 +66,7 @@ main(int argc, char *argv[])
if (0 == argc)
return(EXIT_SUCCESS);
- if (NULL == (e = exprcomp(cs, argv, argc))) {
+ if (NULL == (e = exprcomp(argc, argv))) {
fprintf(stderr, "Bad expression\n");
return(EXIT_FAILURE);
}