unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* RFC: lei q --include/-I and similar switch names
@ 2021-01-25  7:33 Eric Wong
  2021-01-27  2:04 ` Kyle Meyer
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Wong @ 2021-01-25  7:33 UTC (permalink / raw)
  To: meta

"add-external" sometimes feels like an unnecessary burden
for a one-off search, so it'd be nice to be able to search
an external once, or exclude certain externals.

I'm set on supporting "-I$DIR_OR_URL" since that's common
command-line usage for gcc/clang/tcc, perl, ruby to include
extra search paths for headers/modules.

--exclude is naturally the opposite of --include, and I don't
know if --exclude needs a short name.  "-v" (like "grep -v")
isn't available, but maybe "-X" works, since it's something we
can't pass from the CLI to curl.  We're not passing "-x" to
curl, either, but we pass "--proxy" through, of course.

I don't know if "--only" is a good name and don't know of any
common tools with similar functionality (but I know very little
in general :x).  "--exclusive" would be confusing with
"--exclude" and require more typing even with tab-completion.
If we use "--only", then we can use -O for --only since we can't
forward -O to curl, either...

Anyways here's the proposed Getopt::Long spec changes to think
about:

diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index effc6c52..a8f06e2c 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -85,6 +85,7 @@ 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
+	include|I=s@ only|O=s@ exclude=s@
 	torsocks=s no-torsocks verbose|v since|after=s until|before=s),
 	PublicInbox::LeiQuery::curl_opt(), opt_dash('limit|n=i', '[0-9]+') ],
 

The trailing '@' means it's an array and can be specified more
than once, 's' means it's a string ('i' for integers), '=' means
it's a required arg (':' denotes optional args)

And I'll probably split date-time search switches so users can
choose either the easily-faked Date: header or difficult-to-fake
most-recent Received header.  Also, date-time searches will use
git's date parser, and not force users to use YYYYMMDD or similar.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-27  2:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-25  7:33 RFC: lei q --include/-I and similar switch names Eric Wong
2021-01-27  2:04 ` Kyle Meyer

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).