Returning to command line with an appropriate code