From 4b9be88e2465ffcbf91901f06e19a749f6bdf818 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 27 Apr 2021 11:07:52 +0000 Subject: lei lcat: extract Message-IDs from URLs and show them It's a wrapper around "lei q" which extracts Message-IDs from URLs, "<$MSGID>", "id:$MSGID" and attempts to display the local version of the message. Its main purpose is to extract Message-IDs out of commonly-understood URLs to save users bandwidth and time by displaying the message locally. When reading from stdin, it will discard things it doesn't understand, so you can just pipe an entire "Link: $URL" line to it and it'll attempt to pluck the Message-ID out of the URL. --- lib/PublicInbox/LEI.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/PublicInbox/LEI.pm') diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index effc905a..ef72758c 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -149,6 +149,14 @@ our %CMD = ( # sorted in order of importance/use: 'up' => [ 'OUTPUT|--all', 'update saved search', qw(jobs|j=s lock=s@ alert=s@ mua=s verbose|v+ all:s), @c_opt ], +'lcat' => [ '--stdin|MSGID_OR_URL..', 'display local copy of message(s)', + 'stdin|', # /|\z/ must be first for lone dash + # some of these options are ridiculous for lcat + @lxs_opt, qw(output|mfolder|o=s format|f=s dedupe|d=s threads|t+ + sort|s=s reverse|r offset=i jobs|j=s globoff|g augment|a + import-before! lock=s@ rsyncable alert=s@ mua=s verbose|v+), @c_opt, + opt_dash('limit|n=i', '[0-9]+') ], + 'blob' => [ 'OID', 'show a git blob, reconstructing from mail if necessary', qw(git-dir=s@ cwd! verbose|v+ mail! oid-a|A=s path-a|a=s path-b|b=s), @lxs_opt, @c_opt ], -- cgit v1.2.3-24-ge0c7