ouch icon indicating copy to clipboard operation
ouch copied to clipboard

Reintroduce progress bar/indicator

Open marcospb19 opened this issue 7 months ago • 2 comments

Now that we have all logging happening in another thread, we can reintroduce the progress bar to improve how verbose Ouch is by default.

marcospb19 avatar Apr 16 '25 03:04 marcospb19

I was wondering how the code would know how many items were left to process in order to actually make the progress bar, I checked out to f610ff596b56112039326a8dd6749590fb948c4c which was just before the progress bar was removed and it doesn't seem to show progress, just tidies up the logs a bit:

Image

Did this used to work differently even before that commit?

For compression it shouldn't be hard to count the amount of files left to compress. I was initially going to try and see how decompression worked but even compression seemed to not display anything 0_0

AntoniosBarotsis avatar Apr 16 '25 12:04 AntoniosBarotsis

I bet that, at some point, we had a piece of code that gave us a progress estimate, but I don't know where it is 😆.

While .zip provides a .len() function, .tar probably doesn't, so we'd need to jump through all the .tar entries to get a number. However, if it's a .tar.gz and we need to read twice, then we probably need the stream to impl io::Seek, which can't be cheap I think?

So there is definitely a limit on what we can do here, but the first baby step will be to just have a way of indicating progress without being too verbose, imagine the cargo check progress but probably not logging each line after completion, unless -v is provided.

marcospb19 avatar Apr 16 '25 19:04 marcospb19