aboutsummaryrefslogtreecommitdiff
path: root/bp.1
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-15 01:19:10 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-15 01:19:10 -0800
commit8ff80b09ccd7e680829d0911d965ad4b0d6f7939 (patch)
tree399da1a15ed749fa10cec8bf62dcde5e93ef3f3f /bp.1
parent9b70cb4f624aa19c09ea73b3d9e0f50c032602c5 (diff)
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.
Diffstat (limited to 'bp.1')
-rw-r--r--bp.112
1 files changed, 7 insertions, 5 deletions
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<name>\fR:\fI<string-pattern>\fR]
[\fI-r\fR|\fI--replace\fR \fI<replacement>\fR]
[\fI-g\fR|\fI--grammar\fR \fI<grammar file>\fR]
-[\fI-m\fR|\fI--mode\fR \fI<mode>\fR]
+[\fI-c\fR|\fI--conntext\fR \fI<N>\fR]
\fI<pattern\fR
[[--] \fI<input files...>\fR]
.SH DESCRIPTION
@@ -54,10 +54,12 @@ Replace all occurrences of the main pattern with the given string.
.B \-g\fR, \fB--grammar \fI<grammar file>\fR
Load the grammar from the given file.
-.B \-m\fR, \fB--mode \fI<mode>\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<N>\fR
+The number of lines of context to print. If \fI<N>\fR is 0, print only the
+exact text of the matches. If \fI<N>\fR is "all", print the entire file.
+Otherwise, if \fI<N>\fR is a positive integer, print the whole line on which
+matches occur, as well as the \fI<N-1>\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.