Provide a meaningful return code when something when wrong with the command line

Currently, the command line is alway returning zero, even when something went wrong. This should be fixed.