[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gnulib] gnulib-tool: don't ever forget to set $dry again
From: |
Ralf Wildenhues |
Subject: |
Re: [bug-gnulib] gnulib-tool: don't ever forget to set $dry again |
Date: |
Thu, 15 Sep 2005 07:49:31 +0200 |
User-agent: |
Mutt/1.4.1i |
Hi Bruno,
* Bruno Haible wrote on Wed, Sep 14, 2005 at 10:53:53PM CEST:
> Ralf Wildenhues wrote:
> > This patch makes $dry_run obsolete in favor of using $dry only. This
> > way, the repeated and error-prone setting of the latter is eliminated.
>
> Thanks for the patch. I plan to fix this problem, alongside with the
> need for different echo messages in the real case vs. dry-run case
> ("Copying some/file" in the real case vs. "Copy some/file" in the
> dry-run case), by using a variable $dry whose value is either ':' or 'false'.
> So that one case write
> $dry && echo something
> but also
> if $dry; then dosomething; fi
Hmm. This way forces you to write
if $dry; then
echo do something
else
do something
fi
in many current usage cases or use yet another variable again, whereas
with my patch you can just do
$dry do something
but still can do
test -n "$dry" && dosometing_which_is_not_echoed
or even
test "$dry" && ...
and the semantics should still be rather obvious to the reader.
Cheers,
Ralf