Skip to content

Commit b83c97f

Browse files
committed
Return "succeeded" status when outputting help/version info
Any time we ask for help or version info, we should return an "operation succeeded" status when done so the caller knows we did it. Signed-off-by: Ralph Castain <[email protected]>
1 parent 6c9d3dd commit b83c97f

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/util/pmix_cmd_line.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ int pmix_cmd_line_parse(char **pargv, char *shorts,
164164
free(str);
165165
}
166166
pmix_argv_free(argv);
167-
return PMIX_ERR_SILENT;
167+
return PMIX_OPERATION_SUCCEEDED;
168168
}
169169
if (0 == strcmp(ptr, "verbose") || 0 == strcmp(ptr, "v")) {
170170
str = pmix_show_help_string("help-cli.txt", "verbose", false);
@@ -173,7 +173,7 @@ int pmix_cmd_line_parse(char **pargv, char *shorts,
173173
free(str);
174174
}
175175
pmix_argv_free(argv);
176-
return PMIX_ERR_SILENT;
176+
return PMIX_OPERATION_SUCCEEDED;
177177
}
178178
if (0 == strcmp(ptr, "help") || 0 == strcmp(ptr, "h")) {
179179
// they requested help on the "help" option itself
@@ -187,7 +187,7 @@ int pmix_cmd_line_parse(char **pargv, char *shorts,
187187
free(str);
188188
}
189189
pmix_argv_free(argv);
190-
return PMIX_ERR_SILENT;
190+
return PMIX_OPERATION_SUCCEEDED;
191191
}
192192
/* see if the argument is one of our options */
193193
found = false;
@@ -200,7 +200,7 @@ int pmix_cmd_line_parse(char **pargv, char *shorts,
200200
free(str);
201201
}
202202
pmix_argv_free(argv);
203-
return PMIX_ERR_SILENT;
203+
return PMIX_OPERATION_SUCCEEDED;
204204
}
205205
}
206206
if (!found) {
@@ -223,6 +223,8 @@ int pmix_cmd_line_parse(char **pargv, char *shorts,
223223
printf("%s", str);
224224
free(str);
225225
}
226+
pmix_argv_free(argv);
227+
return PMIX_OPERATION_SUCCEEDED;
226228
} else { // unrecognized option
227229
str = pmix_show_help_string("help-cli.txt", "unrecognized-option", true,
228230
pmix_tool_basename, optarg);
@@ -244,7 +246,7 @@ int pmix_cmd_line_parse(char **pargv, char *shorts,
244246
}
245247
// if they ask for the version, that is all we do
246248
pmix_argv_free(argv);
247-
return PMIX_ERR_SILENT;
249+
return PMIX_OPERATION_SUCCEEDED;
248250
default:
249251
/* this could be one of the short options other than 'h' or 'V', so
250252
* we have to check */

0 commit comments

Comments
 (0)