From 9f62d3c7a9f14f07b75a558ee4835ff3bfe0e90b Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 16 Sep 2020 22:39:33 -0700 Subject: Changed arg parsing to '-d foo:baz' for consistency (was: '-d foo=baz') --- bpeg.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'bpeg.c') diff --git a/bpeg.c b/bpeg.c index 9c5a23e..55c2e98 100644 --- a/bpeg.c +++ b/bpeg.c @@ -25,8 +25,8 @@ static const char *usage = ( " -h --help print the usage and quit\n" " -v --verbose print verbose debugging info\n" " -i --ignore-case preform matching case-insensitively\n" - " -d --define = define a grammar rule\n" - " -D --define-string = define a grammar rule (string-pattern)\n" + " -d --define : define a grammar rule\n" + " -D --define-string : define a grammar rule (string-pattern)\n" " -p --pattern provide a pattern (equivalent to bpeg '\\()')\n" " -P --pattern-string provide a string pattern (may be useful if '' begins with a '-')\n" " -r --replace replace the input pattern with the given replacement\n" @@ -114,8 +114,8 @@ int main(int argc, char *argv[]) load_grammar(g, f); // Keep in memory for debug output } else if (FLAG("--define") || FLAG("-d")) { char *def = flag; - char *eq = strchr(def, '='); - check(eq, "Rule definitions must include an '='\n\n%s", usage); + char *eq = strchr(def, ':'); + check(eq, "Rule definitions must include an ':'\n\n%s", usage); *eq = '\0'; char *src = ++eq; vm_op_t *pat = bpeg_pattern(NULL, src); @@ -123,8 +123,8 @@ int main(int argc, char *argv[]) add_def(g, NULL, src, def, pat); } else if (FLAG("--define-string") || FLAG("-D")) { char *def = flag; - char *eq = strchr(def, '='); - check(eq, "Rule definitions must include an '='\n\n%s", usage); + char *eq = strchr(def, ':'); + check(eq, "Rule definitions must include an ':'\n\n%s", usage); *eq = '\0'; char *src = ++eq; vm_op_t *pat = bpeg_stringpattern(NULL, src); -- cgit v1.2.3