+sub _inspect_argv ($$) {
+ my ($lei, $argv) = @_;
+ my $multi = scalar(@$argv) > 1;
+ $lei->out('[') if $multi;
+ while (defined(my $x = shift @$argv)) {
+ inspect1($lei, $x, scalar(@$argv)) or return;
+ }
+ $lei->out(']') if $multi;
+}
+
+sub ins_add { # InputPipe->consume callback
+ my ($lei) = @_; # $_[1] = $rbuf
+ if (defined $_[1]) {
+ $_[1] eq '' and return eval {
+ my $str = delete $lei->{istr};
+ $str =~ s/\A[\r\n]*From [^\r\n]*\r?\n//s;
+ my $eml = PublicInbox::Eml->new(\$str);
+ _inspect_argv($lei, [ 'blob:'.$lei->git_blob_id($eml),
+ map { "mid:$_" } @{mids($eml)} ]);
+ };
+ $lei->{istr} .= $_[1];
+ } else {
+ $lei->fail("error reading stdin: $!");
+ }
+}
+