our %CMD = ( # sorted in order of importance/use:
'q' => [ 'SEARCH_TERMS...', 'search for messages matching terms', qw(
save-as=s output|mfolder|o=s format|f=s dedupe|d=s thread|t augment|a
- sort|s=s reverse|r offset=i remote local! external! pretty mua-cmd=s
+ sort|s=s reverse|r offset=i remote! local! external! pretty mua-cmd=s
torsocks=s no-torsocks verbose|v since|after=s until|before=s),
PublicInbox::LeiQuery::curl_opt(), opt_dash('limit|n=i', '[0-9]+') ],
return send($sock, 'timed out waiting to recv FDs', MSG_EOR);
my @fds = $recv_cmd->($sock, my $buf, 4096 * 33); # >MAX_ARG_STRLEN
if (scalar(@fds) == 4) {
- my $i = 0;
- for my $rdr (qw(<&= >&= >&= <&=)) {
+ for my $i (0..3) {
my $fd = shift(@fds);
- open($self->{$i++}, $rdr, $fd) and next;
- send($sock, "open($rdr$fd) (FD=$i): $!", MSG_EOR);
+ open($self->{$i}, '+<&=', $fd) and next;
+ send($sock, "open(+<&=$fd) (FD=$i): $!", MSG_EOR);
}
} else {
return send($sock, "recv_cmd failed: $!", MSG_EOR);