aboutsummaryrefslogtreecommitdiffstats
path: root/pw.1
diff options
context:
space:
mode:
Diffstat (limited to 'pw.1')
-rw-r--r--pw.155
1 files changed, 55 insertions, 0 deletions
diff --git a/pw.1 b/pw.1
index e423baa..15f3d2f 100644
--- a/pw.1
+++ b/pw.1
@@ -588,6 +588,61 @@ that is the default, this option has no effect unless it appears after a
.B -E
option.
+.IP "\fB-g\fP [\fB!\fP]\fIpattern\fP"
+
+Push
+.I pattern
+onto the grep stack as if using the
+.B :v
+or
+.B :g
+commands, but prior to startup, and hence prior to reading any input.
+
+For more detail, see the
+.B :g
+and
+.B :v
+run-time commands.
+
+A leading
+.B !
+before the pattern indicates inversion, like what is arranged by the
+.B :v
+command. Similarly to the convention in the trigger command syntax,
+to specify a non-inverted pattern which starts with a literal
+.B !
+character, precede that
+.B !
+character with a backslash. This convention is part of the
+.B -g
+option's argument syntax, and not a regular expression escape sequence,
+and is not recognized other than before a non-inverted pattern.
+
+If the
+.B -g
+option is used one or more times, the status display will show
+.B GREP
+followed by the patterns enclosed in parentheses, as usual.
+Patterns pushed by
+.B -g
+may be removed interactively with the
+.B :r
+command.
+
+Whether the
+.I pattern
+argument of a
+.B -g
+is compiled as a BRE or ERE depends on whether a
+.B -B
+or
+.B -E
+option more recently appeared before that
+.B -g
+option. If neither option is used, then
+.I pattern
+is interpreted as a BRE.
+
.SH ENVIRONMENT
.I pw