* @param con context * @param fp output file handle */
| 611 | * @param fp output file handle |
| 612 | */ |
| 613 | static size_t showHelpIntro(poptContext con, FILE * fp) |
| 614 | { |
| 615 | const char *usage_str = POPT_("Usage:"); |
| 616 | size_t len = strlen(usage_str); |
| 617 | POPT_fprintf(fp, "%s", usage_str); |
| 618 | |
| 619 | if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) { |
| 620 | struct optionStackEntry * os = con->optionStack; |
| 621 | const char * fn = (os->argv ? os->argv[0] : NULL); |
| 622 | if (fn == NULL) return len; |
| 623 | if (strchr(fn, '/')) fn = strrchr(fn, '/') + 1; |
| 624 | /* XXX POPT_fprintf not needed for argv[0] display. */ |
| 625 | fprintf(fp, " %s", fn); |
| 626 | len += strlen(fn) + 1; |
| 627 | } |
| 628 | |
| 629 | return len; |
| 630 | } |
| 631 | |
| 632 | void poptPrintHelp(poptContext con, FILE * fp, UNUSED(int flags)) |
| 633 | { |
no test coverage detected