]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
lei: add "lei up" to complement "lei q --save"
[public-inbox.git] / lib / PublicInbox / LEI.pm
index cdb4b347e14760226f178c6331a44ec47fb66356..4b87c104bec98df6936a4af1dc81d56e57f41ee9 100644 (file)
@@ -131,10 +131,12 @@ our %CMD = ( # sorted in order of importance/use:
 'q' => [ '--stdin|SEARCH_TERMS...', 'search for messages matching terms',
        'stdin|', # /|\z/ must be first for lone dash
        @lxs_opt,
-       qw(save-as=s output|mfolder|o=s format|f=s dedupe|d=s threads|t+
+       qw(save output|mfolder|o=s format|f=s dedupe|d=s threads|t+
        sort|s=s reverse|r offset=i pretty 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]+') ],
+'up' => [ 'SEARCH_TERMS...', 'update saved search',
+       qw(jobs|j=s lock=s@ alert=s@ mua=s verbose|v+), @c_opt ],
 
 '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),
@@ -249,7 +251,7 @@ my %OPTDESC = (
 'torsocks=s' => ['VAL|auto|no|yes',
                'whether or not to wrap git and curl commands with torsocks'],
 'no-torsocks' => 'alias for --torsocks=no',
-'save-as=s' => ['NAME', 'save a search terms by given name'],
+'save' =>  "save a search for `lei up'",
 'import-remote!' => 'do not memoize remote messages into local store',
 
 'type=s' => [ 'any|mid|git', 'disambiguate type' ],
@@ -849,6 +851,7 @@ sub start_mua {
        if ($self->{lxs} && $self->{au_done}) { # kick wait_startq
                syswrite($self->{au_done}, 'q' x ($self->{lxs}->{jobs} // 0));
        }
+       return unless -t $self->{2}; # XXX how to determine non-TUI MUAs?
        $self->{opt}->{quiet} = 1;
        delete $self->{-progress};
        delete $self->{opt}->{verbose};