Quick refactoring for cmd line usage (if bad arguments)
Returns error code when catching exception (no core dumps)