Content-Type: multipart/mixed; boundary="===============2313369249709120906==" MIME-Version: 1.0 From: ramesh.thomas at intel.com Subject: [Accel-config] [PATCH v1 8/8] accel-config: Do not return error if help was specifically called Date: Wed, 05 May 2021 13:44:22 -0400 Message-ID: <20210505174422.837248-9-ramesh.thomas@intel.com> In-Reply-To: 20210505174422.837248-1-ramesh.thomas@intel.com To: accel-config@lists.01.org List-ID: --===============2313369249709120906== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Ramesh Thomas Return success when help was specifically requested in commands using the -h and --list-cmds options. Signed-off-by: Ramesh Thomas --- 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, co= nst 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 =3D 0; subcommands[i]; i++) printf("%s ", subcommands[i]); - exit(130); + exit(0); default: /* PARSE_OPT_UNKNOWN */ if (ctx.argv[0][1] =3D=3D '-') { error("unknown option `%s'", ctx.argv[0] + 2); -- = 2.26.3 --===============2313369249709120906==--