Jazz Up Your CLI with Progress Tracking

I have a BeanShell script that takes a few minutes to run. I wanted to provide some feedback on the progress to the user.

I have a BeanShell[2] script that takes a few minutes to run. I wanted to provide some feedback on the progress to the user.

The JUnit text UI tracks progress by printing a series of dots, one per test. This works fine for a relatively small and fixed number of items like unit tests, but in my case, the number of items is much larger and variable. When I tried this approach with my script, the dots scrolled off of the screen, and as a user, I really had no idea how many dots to expect.

If I want to get fancy, I can further enhance the script and print out an estimated time to completion. One caveat, special characters play nicely with terminals, but not so when you redirect output to a file.

Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Participation.