From: Eric Wong Date: Tue, 9 Feb 2021 08:09:34 +0000 (-0100) Subject: lei q: prefix --alert ops with ':' instead of '-' X-Git-Tag: v1.7.0~1144 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=30e9ab9d119d28c2630446948d1d4446311e421d;p=public-inbox.git lei q: prefix --alert ops with ':' instead of '-' Using dashed keywords confuses the option parser without "=" signs (and bash completion doesn't yet work with "="). So use ":" instead of "-" as the prefix for internal ops, since ":" is just as unlikely to be the first character of an executable file in a user's $PATH. --- diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index e2a945a4..e29b13c3 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -227,9 +227,9 @@ my %OPTDESC = ( 'show threads|t' => 'display entire thread a message belongs to', 'q threads|t' => 'return all messages in the same threads as the actual match(es)', -'alert=s@' => ['CMD,-WINCH,-bell,', +'alert=s@' => ['CMD,:WINCH,:bell,', 'run command(s) or perform ops when done writing to output ' . - '(default: "-WINCH,-bell" with --mua and Maildir/IMAP output, ' . + '(default: ":WINCH,:bell" with --mua and Maildir/IMAP output, ' . 'nothing otherwise)' ], 'augment|a' => 'augment --output destination instead of clobbering', @@ -758,14 +758,14 @@ sub poke_mua { # forces terminal MUAs to wake up and hopefully notice new mail my ($self) = @_; my $alerts = $self->{opt}->{alert} // return; while (my $op = shift(@$alerts)) { - if ($op eq '-WINCH') { + if ($op eq ':WINCH') { # hit the process group that started the MUA if ($self->{sock}) { send($self->{sock}, '-WINCH', MSG_EOR); } elsif ($self->{oneshot}) { kill('-WINCH', $$); } - } elsif ($op eq '-bell') { + } elsif ($op eq ':bell') { out($self, "\a"); } elsif ($op =~ /(?fail($@) if $@; if ($opt->{mua} && $lei->{l2m}->lock_free) { $lei->{early_mua} = 1; - $opt->{alert} //= [ '-WINCH,-bell' ] if -t $lei->{1}; + $opt->{alert} //= [ ':WINCH,:bell' ] if -t $lei->{1}; } } $self;