Closed marc-hb closed 3 years ago
basically, I think the usage function itself should not handle exit, the caller should do, in -h
, print usage and exit success, and other condition, print usage and exit failure. but this is another topic.
Totally agree with you @aiChaoSONG but on the other hand this PR is changing a single character :-)
@marc-hb I agree with @aiChaoSONG here, I prefer to remove the "exit(0)" from the usage(), and add 'exit(0)' to the '-h' 'exit(1)' to other callers.
I prefer to remove the "exit(0)" from the usage(), and add 'exit(0)' to the '-h' 'exit(1)' to other callers.
Done!
When some automation script gets some rimage flag wrong then rimage exits and does not run at all. In such a case we want the build to fail immediately and see the error at the bottom of the build logs and not obscured by other, consecutive failures caused by the lack of rimage output.
Take control of the exit code away from usage() and give it back to main() where it belongs.
Signed-off-by: Marc Herbert marc.herbert@intel.com