[Accel-config] [PATCH v1 8/8] accel-config: Do not return error if help was specifically called

ramesh.thomas at intel.com
Newsgroups dev.linux.lists.accel-config
Message-ID <[email protected]>
From: Ramesh Thomas <ramesh.thomas(a)intel.com>

Return success when help was specifically requested in commands using
the -h and --list-cmds options.

Signed-off-by: Ramesh Thomas <ramesh.thomas(a)intel.com>
---
 util/parse-options.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/util/parse-options.c b/util/parse-options.c
index c54ac6d..fa5eaac 100644
--- a/util/parse-options.c
+++ b/util/parse-options.c
@@ -495,7 +495,7 @@ static int parse_options_subcommand_prefix(int argc, const char **argv,
 	parse_options_start(&ctx, argc, argv, prefix, flags);
 	switch (parse_options_step(&ctx, options, usagestr)) {
 	case PARSE_OPT_HELP:
-		exit(129);
+		exit(0);
 	case PARSE_OPT_DONE:
 		break;
 	case PARSE_OPT_LIST_OPTS:
@@ -503,12 +503,12 @@ static int parse_options_subcommand_prefix(int argc, const char **argv,
 			printf("--%s ", options->long_name);
 			options++;
 		}
-		exit(130);
+		exit(0);
 	case PARSE_OPT_LIST_SUBCMDS:
 		if (subcommands)
 			for (int i = 0; subcommands[i]; i++)
 				printf("%s ", subcommands[i]);
-		exit(130);
+		exit(0);
 	default: /* PARSE_OPT_UNKNOWN */
 		if (ctx.argv[0][1] == '-') {
 			error("unknown option `%s'", ctx.argv[0] + 2);
-- 
2.26.3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.