From 8ff80b09ccd7e680829d0911d965ad4b0d6f7939 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 15 Jan 2021 01:19:10 -0800 Subject: Major overhaul of how different modes of behavior work. Approximately 2x speedup and 2x memory footprint reduction. Also removed --mode and VM_HIDE (~ operator), and added --context. Printing works better now. --- bp.1 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bp.1') diff --git a/bp.1 b/bp.1 index fb10a56..2c48799 100644 --- a/bp.1 +++ b/bp.1 @@ -18,7 +18,7 @@ bp \- Bruce's Parsing Expression Grammar tool [\fI-D\fR|\fI--define-string\fR \fI\fR:\fI\fR] [\fI-r\fR|\fI--replace\fR \fI\fR] [\fI-g\fR|\fI--grammar\fR \fI\fR] -[\fI-m\fR|\fI--mode\fR \fI\fR] +[\fI-c\fR|\fI--conntext\fR \fI\fR] \fI\fR] .SH DESCRIPTION @@ -54,10 +54,12 @@ Replace all occurrences of the main pattern with the given string. .B \-g\fR, \fB--grammar \fI\fR Load the grammar from the given file. -.B \-m\fR, \fB--mode \fI\fR -The mode to operate in. Options are: \fIfind-all\fR (the default), -\fIonly-matches\fR, \fIpattern\fR, \fIreplacement\fR, \fIreplace-all\fR -(implied by \fB--replace\fR), or any other grammar rule name. +.B \-c\fR, \fB--context \fI\fR +The number of lines of context to print. If \fI\fR is 0, print only the +exact text of the matches. If \fI\fR is "all", print the entire file. +Otherwise, if \fI\fR is a positive integer, print the whole line on which +matches occur, as well as the \fI\fR lines before and after the match. The +default value for this argument is 1 (print whole lines where matches occur). .B \--help Print the usage and exit. -- cgit v1.2.3