aboutsummaryrefslogtreecommitdiff
path: root/bp.1
diff options
context:
space:
mode:
Diffstat (limited to 'bp.1')
-rw-r--r--bp.129
1 files changed, 28 insertions, 1 deletions
diff --git a/bp.1 b/bp.1
index 1e7f46e..5f1a01c 100644
--- a/bp.1
+++ b/bp.1
@@ -1,12 +1,30 @@
-.\" Automatically generated by Pandoc 3.1.8
+.\" Automatically generated by Pandoc 3.1.6
.\"
+.\" Define V font for inline verbatim, using C font in formats
+.\" that render this, and otherwise B font.
+.ie "\f[CB]x\f[]"x" \{\
+. ftr V B
+. ftr VI BI
+. ftr VB B
+. ftr VBI BI
+.\}
+.el \{\
+. ftr V CR
+. ftr VI CI
+. ftr VB CB
+. ftr VBI CBI
+.\}
.TH "BP" "1" "May 17 2021" "" ""
+.hy
.SH NAME
+.PP
bp - Bruce\[aq]s Parsing Expression Grammar tool
.SH SYNOPSIS
+.PP
\f[B]bp\f[R] [\f[I]options\&...\f[R]] \f[I]pattern\f[R] [[\f[B]--\f[R]]
\f[I]files\&...\f[R]]
.SH DESCRIPTION
+.PP
\f[B]bp\f[R] is a tool that matches parsing expression grammars using a
custom syntax.
.SH OPTIONS
@@ -32,6 +50,11 @@ Print a JSON list of the matches.
Print only the names of files containing matches instead of the matches
themselves.
.TP
+\f[B]-c\f[R], \f[B]--case\f[R]
+Perform pattern matching with case-sensitivity (the default is smart
+casing, i.e.\ case-insensitive, unless there are any uppercase letters
+present).
+.TP
\f[B]-i\f[R], \f[B]--ignore-case\f[R]
Perform pattern matching case-insensitively.
.TP
@@ -92,6 +115,7 @@ used instead.
If neither are provided, \f[B]bp\f[R] will search through all files in
the current directory and its subdirectories (recursively).
.SH STRING PATTERNS
+.PP
One of the most common use cases for pattern matching tools is matching
plain, literal strings, or strings that are primarily plain strings,
with one or two patterns.
@@ -108,6 +132,7 @@ character literal: \f[B]{\[ga]{}\f[R], the string literal:
\f[B]{\[dq]{\[dq]}\f[R], or a pair of matching curly braces using the
\f[B]braces\f[R] rule: \f[B]{braces}\f[R].
.SH PATTERNS
+.PP
\f[B]bp\f[R] patterns are based off of a combination of Parsing
Expression Grammars and regular expression syntax.
The syntax is designed to map closely to verbal descriptions of the
@@ -352,6 +377,7 @@ that also attaches a metadata tag of the same name)
\f[B]#\f[R] \f[I]comment\f[R]
A line comment, ignored by BP
.SH GRAMMAR FILES
+.PP
\f[B]bp\f[R] allows loading extra grammar files, which define patterns
which may be used for matching.
The \f[B]builtins\f[R] grammar file is loaded by default, and it defines
@@ -404,6 +430,7 @@ following command:
\f[B]bp -g c++ \[aq]{comment \[ti] \[dq]TODO\[dq]}\[aq] *.cpp\f[R]
.RE
.SH EXAMPLES
+.PP
Find files containing the literal string \[lq]foo.baz\[rq] (a string
pattern):
.RS