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 7AE4E1F9FD; Thu, 18 Feb 2021 20:42:58 +0000 (UTC) Date: Thu, 18 Feb 2021 20:42:58 +0000 From: Eric Wong To: meta@public-inbox.org Subject: lei q --save-as=... requires too much thinking Message-ID: <20210218204258.GB19443@dcvr> References: <20201218120950.23272-1-e@80x24.org> <20201218120950.23272-3-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201218120950.23272-3-e@80x24.org> List-Id: Eric Wong wrote: > +'query' => [ 'SEARCH-TERMS...', 'search for messages matching terms', qw( s/query/q/ > + save-as=s output|o=s format|f=s dedupe|d=s thread|t augment|a Naming things is hard, so I don't think "lei q --save-as=" needs to exist. Just the "-o DESTINATION" can be tracked and used to infer the metadata used to make the saved search. Maildir outputs can store that information in a ".lei" subdir of the Maildir itself; mboxes and IMAP folders will have it stored in SQLite somewhere. As with externals, there'll be basename shortcuts, so saved searches go into ~/lei-saved/foo/; one can just specify "foo" the next time around as long as the basename is unique. This is following what was done with externals, lei doesn't allow the user to name the external like git remotes (e.g. [remote "origin"] or [publicinbox "foo"]). The normalized URL or pathname is the name of the external; which saves cognitive overhead for my feeble brain. Of course, basename-only expansion and bash completions go a long way towards making URLs/paths usable. > +'ls-query' => [ '[FILTER]', 'list saved search queries', > + qw(name-only format|f=s z) ], > +'rm-query' => [ 'QUERY_NAME', 'remove a saved search' ], > +'mv-query' => [ qw(OLD_NAME NEW_NAME), 'rename a saved search' ], These would operate on pathnames and URLs.