aboutsummaryrefslogtreecommitdiff
path: root/grab.1
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-01-13 01:06:03 +0100
committerThomas Voss <mail@thomasvoss.com> 2024-01-13 01:06:03 +0100
commitbb36535f1a932c7749e58f2abb1cc88364200258 (patch)
treeca9215de58ebdeb4b8dce3558a5f086541be1994 /grab.1
parent253171c7c71b6f89bb674c4adf8b45e17d5432fa (diff)
Support glob arguments to git-grab
Diffstat (limited to 'grab.1')
-rw-r--r--grab.126
1 files changed, 22 insertions, 4 deletions
diff --git a/grab.1 b/grab.1
index 8ee5b28..8bd2e9e 100644
--- a/grab.1
+++ b/grab.1
@@ -15,6 +15,7 @@
.Nm "git grab"
.Op Fl nz
.Ar pattern
+.Op Ar glob ...
.Nm "git grab"
.Fl h
.Sh DESCRIPTION
@@ -39,10 +40,17 @@ The
utility is identical to the
.Nm
utility in all ways except for two exceptions.
-The first is that files cannot be passed as command-line arguments,
-.Nm git-grab
-instead will read all the files specified by an invocation of
-.Xr git-ls-files 1 .
+The first is that if no files
+.Pq globs in this case to be precise
+are specified,
+input is not read from the standard-input but instead all files returned
+by an invocation of
+.Xr git-ls-files 1
+are processed.
+If the user provides one or more globs,
+only the files returned by
+.Xr git-ls-files 1
+that match one or more of the given globs will be processed.
Secondly, the
.Fl f
option is not available;
@@ -156,6 +164,16 @@ List all your systems CPU flags, sorted and without duplicates:
Search for a pattern in multiple files without printing filenames:
.Pp
.Dl $ cat file1 file2 file3 | grab 'x/pattern/'
+.Pp
+Search for usages of an
+.Ql <hb-form-text>
+Vue component —
+but only those which are being passed a
+.Ql placeholder
+property —
+searching all files in the current git-repository:
+.Pp
+.Dl $ git grab 'x/<hb-form-text[^>]+>/ g/\ebplaceholder\eb/' '*.vue'
.Sh SEE ALSO
.Xr git-ls-files 1 ,
.Xr grep 1