Skip to content

Commit

Permalink
0.2.21
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 8, 2024
1 parent 8dcd22a commit 3814b21
Show file tree
Hide file tree
Showing 9 changed files with 263 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
/releases/
1
2
HN
pdf
12 changes: 12 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@ Revision history for App-Rak

{{$NEXT}}

0.2.21 2024-05-08T15:44:12+02:00
- Upped dependency on "rak"
- Fix --paths argument: can now specify multiple paths
separated by comma as per documentation
- Add support for --is-moarvm to only select MoarVM
bytecode files
- Add support for --is-pdf to only select PDF files
- Add support for --pdf-per-line and --pdf-per-file to
search text contents of PDF files
- Add support for --pdf-info to search meta-information
of PDF files

0.2.20 2023-07-31T00:45:03+02:00
- Fix dependency in code (as in the META)

Expand Down
6 changes: 3 additions & 3 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
"IO::Path::AutoDecompress:ver<0.0.2>:auth<zef:lizmat>",
"JSON::Fast::Hyper:ver<0.0.5>:auth<zef:lizmat>",
"META::constants:ver<0.0.3>:auth<zef:lizmat>",
"rak:ver<0.0.47>:auth<zef:lizmat>",
"String::Utils:ver<0.0.21+>:auth<zef:lizmat>"
"rak:ver<0.0.50>:auth<zef:lizmat>",
"String::Utils:ver<0.0.22+>:auth<zef:lizmat>"
],
"description": "21st century grep / find / ack / ag / rg on steroids",
"license": "Artistic-2.0",
Expand Down Expand Up @@ -59,5 +59,5 @@
],
"test-depends": [
],
"version": "0.2.20"
"version": "0.2.21"
}
41 changes: 37 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -432,13 +432,13 @@ Flag. Only makes sense if the pattern is a `Callable`. If specified, indicates t

If <git blame> information can be obtained, then the associated `Git::Blame::File` object will be presented to the pattern `Callable`. If the Callable returns `True`, then the filename will be produced. If anything else is returned, then the stringification of that object will be produced.

Requires the [`Git::Blame::File`](https://raku.land/zef:lizmat/Git::Blame::File) Raku module to be installed.

```bash
# show files with more than 10 commits
$ rak '*.commits > 10' --blame-per-file --files-with-matches
```

Requires that the [`Git::Blame::File`](https://raku.land/zef:lizmat/Git::Blame::File) module is installed.

--blame-per-line
----------------

Expand Down Expand Up @@ -600,6 +600,8 @@ Assumes `zef` is installed and its meta information is available.

Indicate whether the patterns found should be fed into an editor for inspection and/or changes. Defaults to `False`. Optionally takes the name of the editor to be used. If no editor is specified, will use what is in the `EDITOR` environment variable. If that is not specified either, will call "vim".

Requires the [`Edit::Files`](https://raku.land/zef:lizmat/Edit::Files) Raku module to be installed.

--eol=lf|cr|crlf
----------------

Expand Down Expand Up @@ -970,6 +972,11 @@ Flag. If specified, will only select files that can be written to by members of

NOTE: support of this feature depends on Raku supporting that feature on the current operating system.

--is-moarvm
-----------

Flag. If specified, will only select files that appear to be MoarVM bytecode files. Defaults to `False`.

--is-owned-by-group
-------------------

Expand Down Expand Up @@ -1005,6 +1012,11 @@ Flag. If specified, will only select files that can be written to by the owner.

NOTE: support of this feature depends on Raku supporting that feature on the current operating system.

--is-pdf
--------

Flag. If specified, will only select files that appear to be PDF files. Defaults to `False`.

--is-readable
-------------

Expand Down Expand Up @@ -1298,6 +1310,27 @@ Alternative way to specify the pattern to search for. If (implicitly) specified,

Alternative way to specify one or more patterns to search for. Reads the indicated file and interprets each line as a pattern according to the rules (implicitly) set with the `--type` argument. If the file specification is `"-"`, then the patterns will be read from STDIN.

--pdf-info
----------

Flag. Indicates that the meta-info of any PDF file should be produced as single hash to the matcher. Only makes sense if the pattern is a `Callable`. Will also set the `is-pdf` flag to only select PDF files, unless reading from STDIN.

Requires the [`PDF::Extract`](https://raku.land/zef:librasteve/PDF::Extract) Raku module to be installed.

--pdf-per-file
--------------

Flag. Indicates that any PDF file text contents should be produced as single text to the matcher. Will also set the `is-pdf` flag to only select PDF files, unless reading from STDIN.

Requires the [`PDF::Extract`](https://raku.land/zef:librasteve/PDF::Extract) Raku module to be installed.

--pdf-per-line
--------------

Flag. Indicates that any PDF file text contents should be produced as lines to the matcher. Will also set the `is-pdf` flag to only select PDF files, unless reading from STDIN.

Requires the [`PDF::Extract`](https://raku.land/zef:librasteve/PDF::Extract) Raku module to be installed.

--per-file[=code]
-----------------

Expand Down Expand Up @@ -1499,7 +1532,7 @@ Compatible with the `--edit`, `--vimgrep` and the implicit `per-line` option.
$ rak --sourcery 'say "foo"' --edit
```

Requires that the [`sourcery`](https://raku.land/zef:lizmat/sourcery) module is installed.
Requires the [`sourcery`](https://raku.land/zef:lizmat/sourcery) module to be installed.

--stats
-------
Expand Down Expand Up @@ -1542,7 +1575,7 @@ If `--type=code` is specified, then a pattern will be interpreted as Raku source

### json-path

If `--type=json-path` is specified, then a pattern will be interpreted as a `JSON path`. Only makes sense when used together with `--json-per-file`, `--json-per-line` or `--json-per-elem`. Requires that the [`JSON::Path`](https://raku.land/cpan:JNTHN/JSON::Path) module is installed.
If `--type=json-path` is specified, then a pattern will be interpreted as a `JSON path`. Only makes sense when used together with `--json-per-file`, `--json-per-line` or `--json-per-elem`. Requires the [`JSON::Path`](https://raku.land/cpan:JNTHN/JSON::Path) module to be installed.

### contains

Expand Down
54 changes: 48 additions & 6 deletions doc/App-Rak.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -564,15 +564,16 @@ If the Callable returns C<True>, then the filename will be produced. If
anything else is returned, then the stringification of that object will be
produced.

Requires the L<C<Git::Blame::File>|https://raku.land/zef:lizmat/Git::Blame::File>
Raku module to be installed.

=begin code :lang<bash>

# show files with more than 10 commits
$ rak '*.commits > 10' --blame-per-file --files-with-matches

=end code

Requires that the L<C<Git::Blame::File>|https://raku.land/zef:lizmat/Git::Blame::File> module is installed.

=head2 --blame-per-line

Flag. Only makes sense if the pattern is a C<Callable>. If specified,
Expand Down Expand Up @@ -789,6 +790,9 @@ name of the editor to be used. If no editor is specified, will use what
is in the C<EDITOR> environment variable. If that is not specified either,
will call "vim".

Requires the L<C<Edit::Files>|https://raku.land/zef:lizmat/Edit::Files>
Raku module to be installed.

=head2 --eol=lf|cr|crlf

Only applicable if C<--csv-per-line> has been specified. Indicate a
Expand Down Expand Up @@ -1226,6 +1230,11 @@ select files that are B<not> writable by the members of the group of the owner.
NOTE: support of this feature depends on Raku supporting that feature on
the current operating system.

=head2 --is-moarvm

Flag. If specified, will only select files that appear to be MoarVM
bytecode files. Defaults to C<False>.

=head2 --is-owned-by-group

Flag. If specified, will only select files that are owned by the group of
Expand Down Expand Up @@ -1271,6 +1280,11 @@ B<not> writable by the owner.
NOTE: support of this feature depends on Raku supporting that feature on
the current operating system.

=head2 --is-pdf

Flag. If specified, will only select files that appear to be PDF files.
Defaults to C<False>.

=head2 --is-readable

Flag. If specified, will only select files that can be read by the current
Expand Down Expand Up @@ -1647,6 +1661,34 @@ indicated file and interprets each line as a pattern according to the rules
(implicitly) set with the C<--type> argument. If the file specification is
C<"-">, then the patterns will be read from STDIN.

=head2 --pdf-info

Flag. Indicates that the meta-info of any PDF file should be produced
as single hash to the matcher. Only makes sense if the pattern is a
C<Callable>. Will also set the C<is-pdf> flag to only select PDF files,
unless reading from STDIN.

Requires the L<C<PDF::Extract>|https://raku.land/zef:librasteve/PDF::Extract>
Raku module to be installed.

=head2 --pdf-per-file

Flag. Indicates that any PDF file text contents should be produced as
single text to the matcher. Will also set the C<is-pdf> flag to only
select PDF files, unless reading from STDIN.

Requires the L<C<PDF::Extract>|https://raku.land/zef:librasteve/PDF::Extract>
Raku module to be installed.

=head2 --pdf-per-line

Flag. Indicates that any PDF file text contents should be produced as
lines to the matcher. Will also set the C<is-pdf> flag to only select
PDF files, unless reading from STDIN.

Requires the L<C<PDF::Extract>|https://raku.land/zef:librasteve/PDF::Extract>
Raku module to be installed.

=head2 --per-file[=code]

Indicate whether matching should be done per file, rather than per line.
Expand Down Expand Up @@ -1900,8 +1942,8 @@ $ rak --sourcery 'say "foo"' --edit

=end code

Requires that the L<C<sourcery>|https://raku.land/zef:lizmat/sourcery> module
is installed.
Requires the L<C<sourcery>|https://raku.land/zef:lizmat/sourcery> module
to be installed.

=head2 --stats

Expand Down Expand Up @@ -1954,8 +1996,8 @@ source code, as if it was surrounded by curly braces.

If C<--type=json-path> is specified, then a pattern will be interpreted as
a C<JSON path>. Only makes sense when used together with C<--json-per-file>,
C<--json-per-line> or C<--json-per-elem>. Requires that the
L<C<JSON::Path>|https://raku.land/cpan:JNTHN/JSON::Path> module is installed.
C<--json-per-line> or C<--json-per-elem>. Requires the
L<C<JSON::Path>|https://raku.land/cpan:JNTHN/JSON::Path> module to be installed.

=head3 contains

Expand Down

0 comments on commit 3814b21

Please sign in to comment.