Skip to content

Instantly share code, notes, and snippets.

@ItGumby
Created October 13, 2016 03:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ItGumby/e24bdc254419f11b4d4d0d13bf3dff03 to your computer and use it in GitHub Desktop.
Save ItGumby/e24bdc254419f11b4d4d0d13bf3dff03 to your computer and use it in GitHub Desktop.
groovy example of displaying a spinner in CLI apps/scripts
// 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