diff --git a/Changes b/Changes index 577297d..f527645 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,10 @@ Revision history for rak {{$NEXT}} +0.0.44 2022-11-18T17:31:34+01:00 + - Fix issue with --files-from=- and --paths-from=-, spotted by + Márton Polgár. + 0.0.43 2022-11-17T18:54:54+01:00 - Make sure that data fetched from URLs produce strings for the file filter property checks to be performed without issues. diff --git a/META6.json b/META6.json index 55f4725..12fefbb 100644 --- a/META6.json +++ b/META6.json @@ -29,5 +29,5 @@ ], "test-depends": [ ], - "version": "0.0.43" + "version": "0.0.44" } diff --git a/README.md b/README.md index 5a3c2a7..1c48112 100644 --- a/README.md +++ b/README.md @@ -569,8 +569,6 @@ If specified, indicates the name of the file from which a list of paths to be us If specified, indicates a list of paths that should be used as the base of the production of filename with a `paths` search. If there is no other sources specification (from either the `:files-from`, `:paths-from` or `:sources`) then the current directory (aka ".") will be assumed. If that directory appears to be the top directory in a git repository, then `:under-version-control` will be assumed, only producing files that are under version control under that directory. -If a single hyphen is specified as the path, then STDIN will be assumed as the source. - #### :produce-many(&producer) If specified, indicates a `Callable` that will be called given a source, and is expected to produce zero or more items to be inspected. Defaults to a producer that calles the `lines` method on a given source, with the `:encoding` and `:with-line-ending` arguments. diff --git a/doc/rak.rakudoc b/doc/rak.rakudoc index 5e0681b..6b94883 100644 --- a/doc/rak.rakudoc +++ b/doc/rak.rakudoc @@ -690,9 +690,6 @@ appears to be the top directory in a git repository, then C<:under-version-control> will be assumed, only producing files that are under version control under that directory. -If a single hyphen is specified as the path, then STDIN will be -assumed as the source. - =head4 :produce-many(&producer) If specified, indicates a C that will be called given diff --git a/lib/rak.rakumod b/lib/rak.rakumod index 54d4d1d..99a400b 100644 --- a/lib/rak.rakumod +++ b/lib/rak.rakumod @@ -895,20 +895,7 @@ multi sub rak(&pattern, %n) { my $enc := %n:delete // 'utf8-c8'; my $eagerSlip := True; - # Step 1: sources sequence - my $sources-seq = do if !($*IN.t) { - $eagerSlip := False; - $*IN - } - elsif %n:delete -> $sources { - $sources - } - elsif %n:exists && %n eq '-' { - %n:delete; - warn-if-human-on-stdin; - $*IN - } - else { + my sub get-sources-seq() { my $seq := do if %n:delete -> $files-from { paths-from-file($files-from).map: { path-exists($_) ?? $_ !! fetch-if-url($_) @@ -928,6 +915,10 @@ multi sub rak(&pattern, %n) { elsif %n:delete -> $uvc { uvc-paths($uvc) } + elsif !($*IN.t) { + $eagerSlip := False; + return $*IN + } else { paths(".", |paths-arguments(%n)).&hyperize($batch, $degree) } @@ -936,6 +927,9 @@ multi sub rak(&pattern, %n) { make-property-filter($seq, %n); } + # Step 1: sources sequence + my $sources-seq = %n:delete // get-sources-seq; + # sort sources if we want them sorted if %n:delete -> $sort { $sources-seq = Bool.ACCEPTS($sort)