Skip to content

Commit

Permalink
Document --encoding and some --progress fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed May 13, 2024
1 parent 6566f92 commit 945276a
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ Revision history for App-Rak
{{$NEXT}}
- Ignore --progress if STDERR is not a tty. This allows
--progress to be used as a default
- Ignore --progress with --edit option, as the editing can
actually be part of the lazy searching, and you don't
want the announcer running while editing a file
- Document the --encoding option
- Upped dependency on "rak" for hyperizing 2MB+ text files

0.2.24 2024-05-13T15:50:05+02:00
- Allow --edit to work with --files-with-matches and
Expand Down
4 changes: 2 additions & 2 deletions META6.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"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.53>:auth<zef:lizmat>",
"rak:ver<0.0.54>:auth<zef:lizmat>",
"String::Utils:ver<0.0.23+>:auth<zef:lizmat>"
],
"description": "21st century grep / find / ack / ag / rg on steroids",
Expand Down Expand Up @@ -59,5 +59,5 @@
],
"test-depends": [
],
"version": "0.2.24"
"version": "0.2.25"
}
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,11 @@ Indicate whether the patterns found should be fed into an editor for inspection

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

--encoding[=utf8-c8]
--------------------

Indicate the encoding to be used when reading text files. Defaults to [`utf8-c8`](https://docs.raku.org/language/unicode#UTF8-C8). Other encodings are e.g. `utf8` and `ascii`.

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

Expand Down
6 changes: 6 additions & 0 deletions doc/App-Rak.rakudoc
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,12 @@ will call "vim".
Requires the L<C<Edit::Files>|https://raku.land/zef:lizmat/Edit::Files>
Raku module to be installed.

=head2 --encoding[=utf8-c8]

Indicate the encoding to be used when reading text files. Defaults to
L<C<utf8-c8>|https://docs.raku.org/language/unicode#UTF8-C8>. Other
encodings are e.g. C<utf8> and C<ascii>.

=head2 --eol=lf|cr|crlf

Only applicable if C<--csv-per-line> has been specified. Indicate a
Expand Down
3 changes: 2 additions & 1 deletion lib/App/Rak.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use highlighter:ver<0.0.18>:auth<zef:lizmat>; # columns highlighter matches Type
use IO::Path::AutoDecompress:ver<0.0.2>:auth<zef:lizmat>; # IOAD
use JSON::Fast::Hyper:ver<0.0.5>:auth<zef:lizmat>; # from-json to-json
use META::constants:ver<0.0.3>:auth<zef:lizmat> $?DISTRIBUTION;
use rak:ver<0.0.53>:auth<zef:lizmat>; # rak Rak
use rak:ver<0.0.54>:auth<zef:lizmat>; # rak Rak

use Backtrace::Files:ver<0.0.3>:auth<zef:lizmat> <
backtrace-files
Expand Down Expand Up @@ -2689,6 +2689,7 @@ my sub action-csv-per-line(--> Nil) {
}
my sub action-edit(--> Nil) {
%rak<progress>:delete; # no progress indicator if editing
my sub go-edit-error($error --> Nil) {
if backtrace-files($error).map: -> (:key($file), :value(@line)) {
Expand Down
1 change: 1 addition & 0 deletions resources/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ String search pattern modifiers:
Item producers:
--per-line[=producer] Produce lines for pattern matching
--per-file[=producer] Produce whole file for pattern matching
--encoding[=utf8-c8] Encoding to be used when reading text files
--find Produce absolute paths for pattern matching
--csv-per-line Produce rows from Text::CSV object for pattern matching
--pdf-info Produce meta-info of PDF file as a single hash
Expand Down
6 changes: 6 additions & 0 deletions resources/help/item.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ Examples:
# all names of files that have the string "foo" in them
$ rak --per-file --files-with-matches foo

--encoding[=utf8-c8]

Encoding to be used when reading text files. Defaults to "utf8-c8".
Other options are "utf8" and "ascii", but these encoding are more
prone to producing errors.

--find

Produce the paths from the haystack specification and the filesystem
Expand Down

0 comments on commit 945276a

Please sign in to comment.