[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nmh-workers] Sequences have no Zero.

From: Ralph Corderoy
Subject: [Nmh-workers] Sequences have no Zero.
Date: Mon, 30 Jan 2012 15:48:28 +0000


I was bitten the other day by

    $ pick -list -sub foo last | cat; echo exit $?
    pick: no messages match specification
    exit 0

Namely, as described in pick(1)'s BUGS, if stdout isn't a tty then pick
lists the illegal message number 0 to cause errors to propogate, e.g.
through backticks back to rmm(1).

Effectively, I was doing

    foo `pick ...` `pick ...` `pick ...`

and wanted picks that found nothing to silently disappear;  my foo would
do the right thing with no arguments.

It occurred to me just now that we don't have a "none";  mh-sequence(5)
has "all" and Sequence-Negation but

    $ pick notall
    pick: bad message list notall

it seems Sequence-Negation doesn't apply to reserved word "all" and

    $ pick -seq foo all && pick -seq bar notfoo
    6003 hits
    pick: sequence foo full

pick complains rather than effectively do

    mark -seq bar -del all

if sequence bar already exists.

If there was a "none" to pair "all" then pick could -list it instead of
the illegal 0 and it wouldn't be an error that propogates but a
reasonable action, e.g. the same as `scan none'.

Anyone know why the "0" route was chosen at the time?

Cheers, Ralph.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]