]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
lei q: disable remote externals if locals exist
[public-inbox.git] / lib / PublicInbox / LEI.pm
index 890be575fe3ad7799761db990c4043be319cb7d6..378113e8446a4179ef1ac78456004541d0b53677 100644 (file)
@@ -83,9 +83,9 @@ sub _config_path ($) {
 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
-       verbose|v
-       since|after=s until|before=s), opt_dash('limit|n=i', '[0-9]+') ],
+       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]+') ],
 
 'show' => [ 'MID|OID', 'show a given object (Message-ID or object ID)',
        qw(type=s solve! format|f=s dedupe|d=s thread|t remote local!),
@@ -765,11 +765,10 @@ sub accept_dispatch { # Listener {post_accept} callback
                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);