Updating command line output with exit code