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 C6AD11F9FD; Sat, 20 Feb 2021 08:07:16 +0000 (UTC) Date: Sat, 20 Feb 2021 08:07:16 +0000 From: Eric Wong To: Kyle Meyer Cc: meta@public-inbox.org Subject: Re: does "lei q" --format/-f need to exist? Message-ID: <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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <8735xr5i1z.fsf@kyleam.com> List-Id: Kyle Meyer wrote: > Eric Wong writes: > > > Eric Wong wrote: > [...] > >> Alright, I think keeping it and only recommending it for stdout > >> (or --stdin with import) is the way to go. > >> > >> "-o format:/path/name" should be encouraged for regular file and > >> directory args. > > > > Actually, maybe "-o $format" be implicitly stdout? > > (and "-i $format" be implicitly stdin for convert|import) > > Hmm, true. If we went that route, I guess the format auto-detection in > LeiOverview::detect_fmt() (currently just for maildir) would be dropped > because an -o argument without a colon would be taken as the format > rather than a destination that the format can be detected from? 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... On the other hand, maybe only requiring the colon: "-o json:" is enough to disambiguate and isn't too much typing. We'll just assume nobody would want to end a directory with ":". They can still use "-o maildir:/i/like/colons:" if they really want to end a dirname with ":" for whatever reason...