Created
October 13, 2016 03:16
-
-
Save ItGumby/e24bdc254419f11b4d4d0d13bf3dff03 to your computer and use it in GitHub Desktop.
groovy example of displaying a spinner in CLI apps/scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// based on http://groovyconsole.appspot.com/script/277001 from melix | |
def spinner = '|/-\\' | |
print ' ' // need to print something so it can be deleted | |
(0..100).each { i -> | |
print "\u0008${spinner[i%4]}" | |
Thread.sleep(100) // replace with whatever operation you want ;) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment