Closed zerodogg closed 3 years ago
Hmm good point. .await
is a little bit less flexible. I would be happy to merge a pull request if you want to add another adverb. For now another option is the slightly more verbose usage by calling .next
.
Something along these lines:
use Terminal::Spinners;
my $spinner = Spinner.new: type => 'three-dots2';
my $promise = start sleep 3;
print "Working ";
until $promise.status {
$spinner.next;
}
say "\b\b\bdone";
I've got an app that's printing "Working ... " followed by a spinner. When the operation is done, I want to replace the spinner with the word "done". Right now I've got to resort to ansi escape sequences to go back one line, and then reprint the whole string. Having an option to not print a newline when done in .await would be useful.