piotrmurach / tty-spinner

A terminal spinner for tasks that have non-deterministic time frame.
https://ttytoolkit.org
MIT License
427 stars 28 forks source link

Allow multi-level multi spinners #52

Open jason-o-matic opened 8 months ago

jason-o-matic commented 8 months ago

Describe the problem

I have 10 jobs that each have 2 sub-jobs, and I'd like to see a full tree with spinners and sub-spinners.

How would the new feature work?

I could register a multi spinner with a multi spinner, and it would render a nested tree.

spinners = TTY::Spinner::Multi.new("[:spinner] Making 10 Requests...")
sub_spinners_1 = TTY::Spinner::Multi.new("[:spinner] Making 2 Jobs...")
spinners.register(sub_spinners)
sub_spinners.register "[:spinner] Job 1"
# and so on with sub_spinners_2 and more jobs...

Drawbacks

None that I can think of.