void printHelp()

in src/apps/applib/lib/args.c [188:218]


void printHelp(FILE* out, const char* programName, const char* helpText,
               int numArgs, Arg* args[], const char* errorMessage,
               const char* errorDetails) {
    if (errorMessage != NULL) {
        fprintf(out, "%s: %s", programName, errorMessage);
        if (errorDetails != NULL) {
            fprintf(out, ": %s", errorDetails);
        }
        fprintf(out, "\n");
    }
    fprintf(out, "%s: %s\n", programName, helpText);
    fprintf(out, "H3 %d.%d.%d\n\n", H3_VERSION_MAJOR, H3_VERSION_MINOR,
            H3_VERSION_PATCH);

    for (int i = 0; i < numArgs; i++) {
        fprintf(out, "\t");
        for (int j = 0; j < NUM_ARG_NAMES; j++) {
            if (args[i]->names[j] == NULL) continue;
            if (j != 0) fprintf(out, ", ");
            fprintf(out, "%s", args[i]->names[j]);
        }
        if (args[i]->scanFormat != NULL) {
            fprintf(out, " <%s>", args[i]->valueName);
        }
        fprintf(out, "\t");
        if (args[i]->required) {
            fprintf(out, "Required. ");
        }
        fprintf(out, "%s\n", args[i]->helpText);
    }
}