* Display usage text for a table of options. * @param con context * @param fp output file handle * @param columns output display width control * @param opt option(s) * @param translation_domain translation domain * @param done tables already processed * @return */
| 759 | * @return |
| 760 | */ |
| 761 | static size_t singleTableUsage(poptContext con, FILE * fp, columns_t columns, |
| 762 | const struct poptOption * opt, |
| 763 | const char * translation_domain, |
| 764 | poptDone done) |
| 765 | { |
| 766 | if (opt != NULL) |
| 767 | for (; (opt->longName || opt->shortName || opt->arg) ; opt++) { |
| 768 | if (poptArgType(opt) == POPT_ARG_INTL_DOMAIN) { |
| 769 | translation_domain = (const char *)opt->arg; |
| 770 | } else |
| 771 | if (poptArgType(opt) == POPT_ARG_INCLUDE_TABLE) { |
| 772 | void * arg = opt->arg; |
| 773 | /* XXX sick hack to preserve pretense of ABI. */ |
| 774 | if (arg == poptHelpOptions) |
| 775 | arg = poptHelpOptionsI18N; |
| 776 | if (done) { |
| 777 | int i = 0; |
| 778 | if (done->opts != NULL) |
| 779 | for (i = 0; i < done->nopts; i++) { |
| 780 | const void * that = done->opts[i]; |
| 781 | if (that == NULL || that != arg) |
| 782 | continue; |
| 783 | break; |
| 784 | } |
| 785 | /* Skip if this table has already been processed. */ |
| 786 | if (arg == NULL || i < done->nopts) |
| 787 | continue; |
| 788 | if (done->opts != NULL && done->nopts < done->maxopts) |
| 789 | done->opts[done->nopts++] = (const void *) arg; |
| 790 | } |
| 791 | columns->cur = singleTableUsage(con, fp, columns, opt->arg, |
| 792 | translation_domain, done); |
| 793 | } else |
| 794 | if ((opt->longName || opt->shortName) && !F_ISSET(opt, DOC_HIDDEN)) { |
| 795 | columns->cur = singleOptionUsage(fp, columns, opt, translation_domain); |
| 796 | } |
| 797 | } |
| 798 | |
| 799 | return columns->cur; |
| 800 | } |
| 801 | |
| 802 | /** |
| 803 | * Return concatenated short options for display. |
no test coverage detected