bug-wget
[Top][All Lists]
Advanced

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

[Bug-wget] [Bug-Wget] Progress bar implementation. WAS: Re: --progress s


From: Darshit Shah
Subject: [Bug-wget] [Bug-Wget] Progress bar implementation. WAS: Re: --progress should not be overridden by --quiet
Date: Sat, 19 Apr 2014 14:17:42 +0200

On Thu, Apr 17, 2014 at 2:55 PM, Darshit Shah <address@hidden> wrote:
> On Thu, Apr 17, 2014 at 2:49 PM, Gisle Vanem <address@hidden> wrote:
>> "Darshit Shah" <address@hidden> wrote:
>>
>>> progress bar to me. It does not change the existing output so we have
>>> full backward compatibility with existing scripts, but allows the user
>>> to explicitly display the progress bar if required.
>>
>>
>> I don't see your patch is considering the Windows console-title
>> progress indicator. In e.g. retr.c:
>>
> You're right. I completely forgot about the Windows console title. I
> have only considered the progress bar output right now. I'll look into
> mswindows.c and fix that in a while.
>
> Thanks a lot for pointing this out. :)
>
>> #ifdef WINDOWS
>>      if (toread > 0 && !opt.quiet)
>>        ws_percenttitle (100.0 *
>>                         (startpos + sum_read) / (startpos + toread));
>> #endif
>>
>> Maybe this should test for this new option too? Something like:
>>      if (toread > 0 && !opt.quiet || opt.show_progress)
>>     ...
>>
>> But mswindows.c always needs a 'curr_url' to show percentage.
>> I don't think 'ws_changetitle()' will be called as needed for this to
>> happen. The best IMHO would be to drop 'ws_changetitle()' and always have
>> the current-URL as a parameter to 'ws_percenttitle()'.
>>
>
> I honestly haven't looked at the Windows specific part of the codebase
> at all, so I don't know how mswindows.c works. I'll however give it a
> look when I can.
>
>> --gv
>>
>
>
>
> --
> Thanking You,
> Darshit Shah

I have attached a cleaned up patch with the following functional changes:
1. As suggested by Gisle, the console title in Windows will now show
the progress status when displaying the progress bar
2. Fixed a bug wherein the progress bar was not enable by default in
verbose mode.

Apart from this, if anyone has any other comments, please let me know ASAP.

Simultaneously, I'd like to edit the progress bar implementation so
that it looks more like the one in parallel-wget. For those who don't
know, the current implementation looks like this:
xx% [=======>             ] nn,nnn 12.34KB/s  eta 36m 51s

Instead, I propose the following design as has already been
implemented in parallel-wget:
xx% url [=======>         ] nn,nnn 12.34KB/s  eta 36m 51s

The advantage of having the URL in the progress bar itself is that now
in quiet and non-verbose mode when the user chooses --show-progress,
only one needs to be printed instead of 2.

No other part of the Wget output will be changed so as to allow
existing scripts to parse the output without any issues.


-- 
Thanking You,
Darshit Shah

Attachment: 0001-Implement-new-option-show-progress.patch
Description: Text Data


reply via email to

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