Skip to content

Commit

Permalink
All tests are passing again, whee!
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Sep 23, 2022
1 parent c5aeee1 commit 275769f
Show file tree
Hide file tree
Showing 11 changed files with 993 additions and 481 deletions.
8 changes: 8 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ Revision history for App-Rak

{{$NEXT}}
- Add extensions groups for #cro and #html
- Bump dependency on rak to get better --under-version-control semantics
- Bump dependency on String::Utils to get selective importing
- Bump dependency on as-cli-arguments to get Pair support
- Complete rewrite of argument handling. Instead of feeding the
command line arguments into Capture to call MAIN with, process
all command line arguments in order and group them into areas
of interest / appropriate actions. This reduces the number of
checks that need to be made to figure out what to do, and makes
it possible to produce better error reports with regards to the
options specified on the command line.
- Add support for --proximate
- Add support for --human back in
- Add support for --json-per-elem
- Change dependency from JSON::Fast to JSON::Fast::Hyper to allow
for hypering --json-per-elem
- Fix issue with using a regex and --edit

0.0.96 2022-09-12T12:07:41+02:00
- Fix snafu with argument parsing rework bleeding into the distribution
Expand Down
8 changes: 4 additions & 4 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
"build-depends": [
],
"depends": [
"as-cli-arguments:ver<0.0.4>:auth<zef:lizmat>",
"as-cli-arguments:ver<0.0.6>:auth<zef:lizmat>",
"CLI::Help:ver<0.0.4>:auth<zef:lizmat>",
"CLI::Version:ver<0.0.7>:auth<zef:lizmat>",
"Edit::Files:ver<0.0.4>:auth<zef:lizmat>",
"has-word:ver<0.0.3>:auth<zef:lizmat>",
"highlighter:ver<0.0.14>:auth<zef:lizmat>",
"JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>",
"rak:ver<0.0.22>:auth<zef:lizmat>",
"String::Utils:ver<0.0.10>:auth<zef:lizmat>",
"JSON::Fast::Hyper:ver<0.0.3>:auth<zef:lizmat>",
"rak:ver<0.0.24>:auth<zef:lizmat>",
"String::Utils:ver<0.0.12>:auth<zef:lizmat>",
"META::constants:ver<0.0.2>:auth<zef:lizmat>"
],
"description": "21st century grep / find / ack / ag / rg on steroids",
Expand Down
2 changes: 2 additions & 0 deletions bin/rak
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use App::Rak;

main(@*ARGS);

# vim: expandtab shiftwidth=4
34 changes: 34 additions & 0 deletions doc/App-Rak.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,14 @@ a line. Specifying implies C<--highlight>ing implicitly. If C<highlight>
is explicitely specified with a trueish value, will default to the terminal
code to start B<bold>.

=head2 --human

Flag. Indicate that search results should be presented in a human readable
manner. This means: filenames shown on a separate line, line numbers
shown, and highlighting performed. Defaults to C<True> if C<STDOUT> is
a TTY (aka, someone is actually watching the search results), otherwise
defaults to C<False>.

=head2 --ignorecase

Flag. If specified with a trueish value, indicates that any matching should
Expand Down Expand Up @@ -660,6 +668,25 @@ Flag. If specified with a trueish value, will only select files that can be
written to by the current user. Use negation C<--/is-writable> to only select
files that can B<not> be written to by the current user.

=head2 --json-per-elem

Flag. Only makes sense if the pattern is a C<Callable>. If specified with
a C<True> value, indicates that each selected file will be interpreted
as JSON, and if valid, will then produce all elements of the outermost
data structure to the pattern for introspection. If the data structure
is a hash, then key/value C<Pair>s will be produced.

If the Callable returns a true value, the element will be shown. If
the returned value is a string, that string will be mentioned. For example
when searching the list of modules in the zef ecosystem (which consists of
an array of hashes):

=begin code :lang<bash>

$ rak '{ $_ with .<auth> }' META.json --json-per-elem

=end code

=head2 --json-per-file

Flag. Only makes sense if the pattern is a C<Callable>. If specified with
Expand Down Expand Up @@ -919,6 +946,13 @@ $ rak foo --per-file='*.lines(:!chomp).head(10).join'

=end code

==head2 --proximate=[N]

Indicates whether matched lines should be grouped together that are within
N lines of each other. This is useful for visually picking out matches that
appear close to other matches. If specified as a flag, indicates a
proximation of B<1>. Defaults to B<0>, indication no proximation.

=head2 --quietly

Flag. Only makes sense if the pattern is a C<Callable>. If specified
Expand Down
Loading

0 comments on commit 275769f

Please sign in to comment.