about summary refs log tree commit homepage
path: root/lib
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-02-06 12:18:43 +0000
committerEric Wong <e@80x24.org>2021-02-07 03:34:32 +0000
commit52ddb3d1f9d2cd2ff70d8543ec4a8b1439486e85 (patch)
treeb9c93e21e7579ce29155bad2c7ef005c548ad555 /lib
parente591a7bfdd57884f187afbf2229f2834639a4489 (diff)
downloadpublic-inbox-52ddb3d1f9d2cd2ff70d8543ec4a8b1439486e85.tar.gz
Seeing --config in the command-line for lei may mislead users
into thinking we support config file overrides that way.  Rename
the option to --curl-config and drop the short switch for now.
Diffstat (limited to 'lib')
-rw-r--r--lib/PublicInbox/LeiCurl.pm7
-rw-r--r--lib/PublicInbox/LeiQuery.pm5
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiCurl.pm b/lib/PublicInbox/LeiCurl.pm
index c8747d4f..38b17c78 100644
--- a/lib/PublicInbox/LeiCurl.pm
+++ b/lib/PublicInbox/LeiCurl.pm
@@ -8,6 +8,10 @@ use v5.10.1;
 use PublicInbox::Spawn qw(which);
 use PublicInbox::Config;
 
+my %lei2curl = (
+        'curl-config=s@' => 'config|K=s@',
+);
+
 # prepares a common command for curl(1) based on $lei command
 sub new {
         my ($cls, $lei, $curl) = @_;
@@ -17,6 +21,9 @@ sub new {
         $cmd[-1] .= 's' if $opt->{quiet}; # already the default for "lei q"
         $cmd[-1] .= 'v' if $opt->{verbose}; # we use ourselves, too
         for my $o ($lei->curl_opt) {
+                if (my $lei_spec = $lei2curl{$o}) {
+                        $o = $lei_spec;
+                }
                 $o =~ s/\|[a-z0-9]\b//i; # remove single char short option
                 if ($o =~ s/=[is]@\z//) {
                         my $ary = $opt->{$o} or next;
diff --git a/lib/PublicInbox/LeiQuery.pm b/lib/PublicInbox/LeiQuery.pm
index 7c856032..63945d53 100644
--- a/lib/PublicInbox/LeiQuery.pm
+++ b/lib/PublicInbox/LeiQuery.pm
@@ -155,9 +155,12 @@ sub _complete_q {
 # TODO: should we depend on "-c http.*" options for things which have
 # analogues in git(1)? that would reduce likelyhood of conflicts with
 # our other CLI options
+# Note: some names are renamed to avoid potential conflicts,
+# see %lei2mail in lib/PublicInbox/LeiCurl.pm
 sub curl_opt { qw(
+        curl-config=s@
         abstract-unix-socket=s anyauth basic cacert=s capath=s
-        cert-status cert-type cert=s ciphers=s config|K=s@
+        cert-status cert-type cert=s ciphers=s
         connect-timeout=s connect-to=s cookie-jar=s cookie=s crlfile=s
         digest disable dns-interface=s dns-ipv4-addr=s dns-ipv6-addr=s
         dns-servers=s doh-url=s egd-file=s engine=s false-start