[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-wget] Use stderr instead of stdout for --ask-password
From: |
Giuseppe Scrivano |
Subject: |
Re: [Bug-wget] Use stderr instead of stdout for --ask-password |
Date: |
Wed, 23 Feb 2011 10:23:50 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) |
Hello Gilles,
thanks for your patch. I am not sure it is a good idea to use stderr
to prompt a message to the user. I would just inhibit the message when
-O- is used.
Cheers,
Giuseppe
Gilles Carry <address@hidden> writes:
> Hello,
>
> Here is a small patch to change the ask-password behaviour.
> You may find the explanation in patch's changelog.
> I confess I did not test much this patch.
>
> Best regards,
> Thank-you,
> Gilles.
>
> diff --git a/src/ChangeLog b/src/ChangeLog
> index f37814d..b9bf2d7 100644
> --- a/src/ChangeLog
> +++ b/src/ChangeLog
> @@ -1,3 +1,13 @@
> +2011-02-22 Gilles Carry <gilles dot carry at st dot com>
> +
> + * main.c (prompt_for_password): Use stderr instead of stdout
> + to prompt password. This allows to use --output-document=- and
> + --ask-password simultaneously. Without this, redirecting stdout
> + makes password prompt invisible and mucks up payload such as in
> + this example:
> + wget --output-document=- --ask-password -user=foo \
> + http://foo.com/tarball.tgz | tar zxf -
> +
> 2009-09-22 Micah Cowan <address@hidden>
>
> * openssl.c (ssl_check_certificate): Avoid reusing the same buffer
> diff --git a/src/main.c b/src/main.c
> index dddc4b2..db1638f 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -725,9 +725,9 @@ static char *
> prompt_for_password (void)
> {
> if (opt.user)
> - printf (_("Password for user %s: "), quote (opt.user));
> + fprintf (stderr, _("Password for user %s: "), quote (opt.user));
> else
> - printf (_("Password: "));
> + fprintf (stderr, _("Password: "));
> return getpass("");
> }
>
- [Bug-wget] Use stderr instead of stdout for --ask-password, Gilles Carry, 2011/02/22
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password,
Giuseppe Scrivano <=
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password, Gilles Carry, 2011/02/23
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password, Micah Cowan, 2011/02/23
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password, Giuseppe Scrivano, 2011/02/23
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password, Micah Cowan, 2011/02/23
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password, Giuseppe Scrivano, 2011/02/24
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password, Ángel González, 2011/02/24
- Re: [Bug-wget] Use stderr instead of stdout for --ask-password, Micah Cowan, 2011/02/24