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=-3.4 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 0DA7E1F9FE for ; Tue, 23 Feb 2021 03:45:56 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1614051954; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=nWHRO9lHtM6XhU0t26n5hFpTrcKaRrsoq2ZjOGNxHo8=; b=dDGZrXCQDYiQPk468ZXW+NgzMr1EsqjGYTtiuYNlH1CJQxmw+0uvVC8ju6Lfo+eCIYRg21 LOOhx++vRifWhHeysnvdpUsM2c0qr2klO1nM6HVCkYKf905IrM6b9LHMwhIIs2EkGjLuCV TVBmUZp7yrR2tbDwn+fY4gy2QHm7bPCaMY3eT0KvGhcLJzDfAXLaQPpx50Qau7eKesgq39 DCnji2wxuYK7o81kRktSBG58Dh5WJWfDip1vb7ETeUmjClC+Q4sJUryCbgegTuWrk1KWX2 dBMQAOLacUyPA6wvZ5VMJdIBAPMNlTulLqo1bvAh53RA6VlYPz4mi2wvb5WYrw== From: Kyle Meyer To: Eric Wong Cc: meta@public-inbox.org Subject: [PATCH] doc: lei: favor "-o format:$PATHNAME" over "-f" In-Reply-To: <20210220080716.GA30570@dcvr> References: <20210217044032.GA17934@dcvr> <87r1le2bdo.fsf@kyleam.com> <20210218120722.GA14112@dcvr> <87k0r43g7w.fsf@kyleam.com> <20210219111334.GA25690@dcvr> <20210219190628.GA1129@dcvr> <8735xr5i1z.fsf@kyleam.com> <20210220080716.GA30570@dcvr> Date: Mon, 22 Feb 2021 22:45:52 -0500 Message-ID: <87wnuzsaz3.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com List-Id: Eric Wong writes: > Maybe not dropped, but probably tweaked for DWIM-ness. > > Maybe: > > If somebody wants a Maildir to dump JSON search results in they > could use "-o ./json" or "-o json/" or "-o /path/to/json". > > "-o json" (no slashes or colons) would mean JSON output to stdout. > > But then, "json" could be the name of an existing directory, > so if it exists... > > Part of me thinks its too magical... That's kind of my feeling, though I suspect that would at least consistently do what I mean and be unsurprising. > On the other hand, maybe only requiring the colon: "-o json:" > is enough to disambiguate and isn't too much typing. Yeah, I don't mind that, but I guess that almost gets us back to "-o json:-". Then again, I didn't mind that either or really any of the options proposed in this thread :) Anyway, no matter where this lands, the manpages should switch to using/recommending the : prefix, so here's a patch for that. -- >8 -- Subject: [PATCH] doc: lei: favor "-o format:$PATHNAME" over "-f" The --format argument is redundant and may be dropped entirely. Update the lei manpages to prefer the format prefix. cf. https://public-inbox.org/meta/20210217044032.GA17934@dcvr/ --- Documentation/lei-import.pod | 10 ++++++---- Documentation/lei-overview.pod | 4 ++-- Documentation/lei-q.pod | 20 ++++++++++++++------ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/Documentation/lei-import.pod b/Documentation/lei-import.pod index 14ca2d45d6d8bfa1..2051e6bc86c5fd36 100644 --- a/Documentation/lei-import.pod +++ b/Documentation/lei-import.pod @@ -11,8 +11,10 @@ lei import [OPTIONS] --stdin =head1 DESCRIPTION Import messages into the local storage of L. C is a -source of messages: a directory (Maildir) or a file (whose format is -specified via C<--format>). +source of messages: a directory (Maildir) or a file. For a regular +file, the location must have a CformatE:> prefix specifying +one of the following formats: C, C, C, +C, or C. TODO: Update when URL support is added. @@ -22,8 +24,8 @@ TODO: Update when URL support is added. =item -f MAIL_FORMAT, --format=MAIL_FORMAT -Message input format: C, C, C, C, -C. +Message input format. Unless messages are given on C, using a +format prefix with C is preferred. =item --stdin diff --git a/Documentation/lei-overview.pod b/Documentation/lei-overview.pod index 840d011b27adb088..62b62280ad2ddd69 100644 --- a/Documentation/lei-overview.pod +++ b/Documentation/lei-overview.pod @@ -16,7 +16,7 @@ L. =over -=item $ lei import --format=mboxrd t.mbox +=item $ lei import mboxrd:t.mbox Import the messages from an mbox into the local storage. @@ -64,7 +64,7 @@ Search for messages whose subject includes "lei" and "skeleton". Do the same, but also report unmatched messages that are in the same thread as a matched message. -=item $ lei q -t -o t.mbox -f mboxcl2 --mua=mutt s:lei s:skeleton +=item $ lei q -t -o mboxcl2:t.mbox --mua=mutt s:lei s:skeleton Write mboxcl2-formatted results to t.mbox and enter mutt to view the file by invoking C. diff --git a/Documentation/lei-q.pod b/Documentation/lei-q.pod index c8df6fc7244bfae6..75fdc613579cdc18 100644 --- a/Documentation/lei-q.pod +++ b/Documentation/lei-q.pod @@ -26,17 +26,25 @@ Read search terms from stdin. =item -o MFOLDER, --output=MFOLDER, --mfolder=MFOLDER -Destination for results (e.g., C or - for stdout). +Destination for results (e.g., C or +C). The format can be specified by adding a +CformatE:> prefix with any of these values: C, +C, C, C, C, C, C, or +C. + +TODO: Provide description of formats? + +When a format isn't specified, it's chosen based on the destination. +C is used for the default destination (stdout), and C +is used for an existing directory or non-existing path. Default: - =item -f FORMAT, --format=FORMAT -Format of results: C, C, C, C, -C, C, C, or C. The default format -used depends on C<--output>. - -TODO: Provide description of formats? +Format of results. This option exists as a convenient way to specify +the format for the default stdout destination. Using a C +prefix with the C<--output> destination is preferred otherwise. =item --pretty base-commit: c1ad789a90c274f9912d53bb1c7f1a3cc07cb233 -- 2.30.1