diff --git a/orte/util/show_help.c b/orte/util/show_help.c index c3bde2a57e..d49a28ae2a 100644 --- a/orte/util/show_help.c +++ b/orte/util/show_help.c @@ -612,7 +612,6 @@ int orte_show_help(const char *filename, const char *topic, bool want_error_header, ...) { int rc = ORTE_SUCCESS; - int8_t have_output = 1; va_list arglist; char *output; @@ -630,6 +629,17 @@ int orte_show_help(const char *filename, const char *topic, return ORTE_SUCCESS; } + rc = orte_show_help_norender(filename, topic, want_error_header, output); + free(output); + return rc; +} + +int orte_show_help_norender(const char *filename, const char *topic, + bool want_error_header, const char *output) +{ + int rc = ORTE_SUCCESS; + int8_t have_output = 1; + if (!ready) { /* if we are finalizing, then we have no way to process * this through the orte_show_help system - just drop it to @@ -692,7 +702,6 @@ int orte_show_help(const char *filename, const char *topic, } CLEANUP: - free(output); return rc; } diff --git a/orte/util/show_help.h b/orte/util/show_help.h index 4dca374dfc..14975372a9 100644 --- a/orte/util/show_help.h +++ b/orte/util/show_help.h @@ -71,6 +71,15 @@ ORTE_DECLSPEC void orte_show_help_finalize(void); ORTE_DECLSPEC int orte_show_help(const char *filename, const char *topic, bool want_error_header, ...); +/** + * Exactly the same as orte_show_help, but pass in a rendered string, + * rather than a varargs list which must be rendered. + */ +ORTE_DECLSPEC int orte_show_help_norender(const char *filename, + const char *topic, + bool want_error_header, + const char *output); + /** * Pretend that this message has already been shown. *