From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id C1DB21F4B4; Mon, 25 Jan 2021 07:33:47 +0000 (UTC) Date: Sun, 24 Jan 2021 21:33:47 -1000 From: Eric Wong To: meta@public-inbox.org Subject: RFC: lei q --include/-I and similar switch names Message-ID: <20210125073347.GA15401@dcvr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline List-Id: "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.