From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 16/17] lei_curl: replace -K/--config with --curl-config
Date: Sat, 6 Feb 2021 12:18:43 +0000 [thread overview]
Message-ID: <20210206121844.10979-17-e@80x24.org> (raw)
In-Reply-To: <20210206121844.10979-1-e@80x24.org>
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.
---
lib/PublicInbox/LeiCurl.pm | 7 +++++++
lib/PublicInbox/LeiQuery.pm | 5 ++++-
2 files changed, 11 insertions(+), 1 deletion(-)
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
next prev parent reply other threads:[~2021-02-06 12:18 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-06 12:18 [PATCH 00/17] lei: more random updates Eric Wong
2021-02-06 12:18 ` [PATCH 01/17] lei_overview: drop unnecessary autoflush call Eric Wong
2021-02-06 12:18 ` [PATCH 02/17] lei: favor "keywords" over "flags", test --no-kw Eric Wong
2021-02-06 12:18 ` [PATCH 03/17] lei: fix completion of --no-kw / --no-keywords Eric Wong
2021-02-06 12:18 ` [PATCH 04/17] lei: abort lei_import worker on client abort Eric Wong
2021-02-06 12:18 ` [PATCH 05/17] init: lowercase -j for --jobs Eric Wong
2021-02-06 12:18 ` [PATCH 06/17] lei_query: trim curl options Eric Wong
2021-02-06 12:18 ` [PATCH 07/17] tests: add test_lei wrapper, split out t/lei-import.t Eric Wong
2021-02-06 12:18 ` [PATCH 08/17] t/lei-externals: split out into separate test Eric Wong
2021-02-06 12:18 ` [PATCH 09/17] t/tests: split out setup_public_inboxes sub Eric Wong
2021-02-06 12:18 ` [PATCH 10/17] tests: split out lei-daemon.t from lei.t Eric Wong
2021-02-06 12:18 ` [PATCH 11/17] treewide: replace confess with croak Eric Wong
2021-02-06 12:18 ` [PATCH 12/17] script/lei: avoid waitpid(-1, ...) to keep tests fast Eric Wong
2021-02-06 12:18 ` [PATCH 13/17] lei: add-external --mirror support Eric Wong
2021-02-06 12:18 ` [PATCH 14/17] lei help: split out into separate file Eric Wong
2021-02-06 12:18 ` [PATCH 15/17] lei add-external: reject index and remote opts w/o mirror Eric Wong
2021-02-06 12:18 ` Eric Wong [this message]
2021-02-06 12:18 ` [PATCH 17/17] lei: remove short switch support for curl(1) options Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210206121844.10979-17-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).