carlossg/glacier-cli — pull request #11 by patrickdlee (2012-12-20 05:53:10+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. A final catch block has also been added to catch all other exceptions and display the type and message.

I realize that these changes add quite a bit of code and increase the overall complexity of the project, but I also think that readability is improved and that future changes such as the addition of new commands/options will be easier in the long run.