From: Kamalesh Babulal Date: Thu, 29 Sep 2022 10:19:50 +0000 (+0530) Subject: tools: introduce bad arguments exit code X-Git-Tag: v3.1.0~303 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38d48493df8b5cba30b7ae29d738b11f4e1958e1;p=thirdparty%2Flibcgroup.git tools: introduce bad arguments exit code Introduce EXIT_BADARGS (129) error code to return, when the user passes an invalid list of arguments. Currently, we return exit 1 which refers to a general error, or exit -1 which wraps to 255, both codes do not signify bad arguments. Let's use EXIT_BADARGS (exit code 129), from tools hinting to the users about invalid usage. Suggested-by: Tom Hromatka Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/src/tools/tools-common.h b/src/tools/tools-common.h index 5f3d55f1..04888434 100644 --- a/src/tools/tools-common.h +++ b/src/tools/tools-common.h @@ -28,6 +28,8 @@ extern "C" { #define err(x...) fprintf(stderr, x) #define info(x...) fprintf(stdout, x) +#define EXIT_BADARGS 129 + /** * Auxiliary specifier of group, used to store parsed command line options. */