We have a ton of files, and commands such as size can take a long time with no idea of how long, and that can be frustrating. Is there a way, and if not please add it, for the --progress flag to also work on directory listings.
This could also work on the ls commands that output to json.
as for cloud providers, there is not a file system and no way to get such information.
in fact, many provides limit the number of files listed per api call to 1000 and many such api calls are required and with many providers, each api costs money.
Ok then, what about going with the rsync approach? they show something like 321/654 with the first being the number left to process and the second is the total discovered (so far).
I'll reiterate this.
Neither of the above require making any extra calls, while still showing progress is being made. Usually people have an idea of how many files there are, and can guesstimate if they see how many have been processed. Anything is better than nothing.
I think @ncw could comment, but my understanding is it walks through the file system based on getting 'chunks' of data based and it doesn't know what it finds until it progresses.
I'm not sure what the original use case of rclone size was so not sure it's used much/often.
"Progress" doesn't necessarily mean "estimated percent completed". At the most basic, a simple number that gets incremented when it does a thing. See my rsync suggestion.
Not showing anything during a long task is very bad UX, which means I don't know if the program is doing what it claims to be doing or if it's stuck and not doing anything.
The progress/stats seems to be explicitly disabled for the size command by the second parameter (showStats=false) in this function call. The same is seen for the ls command.
I guess the purpose is to keep the default output from these commands clean from any progress information, if used in a subsequent script/program - otherwise stats would print every 1 minute with the current defaults.
There may be ways to get the best of both worlds, thinking...
The progress of the elapsed time is basic and similar to a rotating gear, hourglass, etc. and as such fulfils the OP's request to minimum have some kind of indication that the program is busy/working:
I fully agree, it would be nice if the progress/stats information also included the number of directory items processed/pending. Especially in situations like size or a sync with a very restrictive filter.