carlossg/glacier-cli — pull request #12 by patrickdlee (2012-12-20 18:08:17+00:00)
Title: added more robust error handling and improved readability of main() method

I added a GlacierCliCommand enum to enumerate the valid commands and replaced the if/else logic in the main() method with a switch statement. I also added a GlacierCliException class and refactored the main method to throw this exception whenever an invalid combination of command and options is used. The GlacierCliException is caught near the end of the main() method and the error message is displayed as well as the help text.

This pull request is a follow-up on my previous request. In this one, I have removed the final catch block and squashed all the commits as Carlos requested.