[darcs-devel] [patch1288] fixed completion for help command

Ben Franksen ben.franksen at online.de
Sun Feb 22 19:41:06 UTC 2015


Ben Franksen wrote:
> The extra " || true" I appended to the line
> 
>   sub_commands="$(darcs $cmd --list-options | grep -v -- -- || true)"
> 
> was necessary when I last tested it, because I got errors when the grep -v
> returned nothing. But when I test again now it works without this
> addition. Strange. It doesn't hurt to have it in there but if you want I
> can remove it.

I see now why I changed this: it is also something that is uncovered by my 
other patch. The variable assignment really fails if the 'grep -v' fails (to 
produce any output). However, since Darcs (without my other patch) produces 
an extra (empty) line with --list-options, the grep -v succeeds. Relying on 
this in the test script is not a good idea, so I guess adding the extra " || 
true" is a good move.

Cheers
Ben
-- 
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies and the other
way is to make it so complicated that there are no obvious deficiencies.
The first method is far more difficult."   ― C.A.R. Hoare




More information about the darcs-devel mailing list