Lines Matching refs:opt
137 * @param opt option(s)
140 getTableTranslationDomain(const struct poptOption *opt)
142 if (opt != NULL)
143 for (; opt->longName || opt->shortName || opt->arg; opt++) {
144 if (opt->argInfo == POPT_ARG_INTL_DOMAIN)
145 return opt->arg;
151 * @param opt option(s)
155 getArgDescrip(const struct poptOption * opt,
159 if (!poptArgType(opt)) return NULL;
161 if (poptArgType(opt) == POPT_ARG_MAINCALL)
162 return opt->argDescrip;
163 if (poptArgType(opt) == POPT_ARG_ARGV)
164 return opt->argDescrip;
166 if (opt->argDescrip) {
168 if (opt == (poptHelpOptions + 1)
169 || opt == (poptHelpOptions + 2)
170 || !strcmp(opt->argDescrip, N_("Help options:"))
171 || !strcmp(opt->argDescrip, N_("Options implemented via popt alias/exec:")))
172 return POPT_(opt->argDescrip);
175 return D_(translation_domain, opt->argDescrip);
178 switch (poptArgType(opt)) {
201 * @param opt option(s)
207 const struct poptOption * opt,
221 if (opt->arg) { /* XXX programmer error */
222 poptArg arg = { .ptr = opt->arg };
223 switch (poptArgType(opt)) {
245 le += sprintf(le, "%p", opt->arg);
248 le += sprintf(le, "%p", opt->arg);
281 * @param opt option(s)
285 const struct poptOption * opt,
291 const char * help = D_(translation_domain, opt->descrip);
292 const char * argDescrip = getArgDescrip(opt, translation_domain);
294 int prtshort = (int)(isprint((int)opt->shortName) && opt->shortName != ' ');
302 if (opt->longName) nb += strlen(opt->longName);
303 if (F_ISSET(opt, TOGGLE)) nb += sizeof("[no]") - 1;
311 #define prtlong (opt->longName != NULL) /* XXX splint needs a clue */
315 const char *dash = F_ISSET(opt, ONEDASH) ? "-" : "--";
317 left[1] = opt->shortName;
318 (void) stpcpy(stpcpy(stpcpy(left+2, ", "), dash), opt->longName);
321 left[1] = opt->shortName;
325 const char *dash = poptArgType(opt) == POPT_ARG_MAINCALL ? ""
326 : (F_ISSET(opt, ONEDASH) ? "-" : "--");
327 const char *longName = opt->longName;
329 if (F_ISSET(opt, TOGGLE)) {
345 if (F_ISSET(opt, OPTIONAL))
349 if (F_ISSET(opt, SHOW_DEFAULT)) {
350 defs = singleOptionDefaultValue(lineLength, opt, translation_domain);
366 if (opt->argDescrip == NULL) {
367 switch (poptArgType(opt)) {
372 { long aLong = opt->val;
373 int ops = F_ISSET(opt, LOGICALOPS);
374 int negate = F_ISSET(opt, NOT);
393 *le++ = (opt->longName != NULL ? '=' : ' ');
407 *le++ = (opt->longName != NULL ? '=' : ' ');
418 *le++ = ((poptArgType(opt) == POPT_ARG_MAINCALL) ? ' ' :
419 (poptArgType(opt) == POPT_ARG_ARGV) ? ' ' :
420 opt->longName == NULL ? ' ' : '=');
426 if (F_ISSET(opt, OPTIONAL))
484 * @param opt option(s)
488 static size_t maxArgWidth(const struct poptOption * opt,
495 if (opt != NULL)
496 while (opt->longName || opt->shortName || opt->arg) {
497 if (poptArgType(opt) == POPT_ARG_INCLUDE_TABLE) {
498 void * arg = opt->arg;
505 } else if (!F_ISSET(opt, DOC_HIDDEN)) {
509 if (opt->longName) {
510 len += (F_ISSET(opt, ONEDASH) ? sizeof("-") : sizeof("--")) - 1;
511 len += strlen(opt->longName);
514 argDescrip = getArgDescrip(opt, translation_domain);
525 if (F_ISSET(opt, OPTIONAL)) len += sizeof("[]")-1;
528 opt++;
552 const struct poptOption * opt;
553 opt = &item->option;
554 if ((opt->longName || opt->shortName) && !F_ISSET(opt, DOC_HIDDEN))
555 singleOptionHelp(fp, columns, opt, translation_domain);
572 const struct poptOption * opt;
582 for (opt = table; opt->longName || opt->shortName || opt->arg; opt++) {
583 if ((opt->longName || opt->shortName) && !F_ISSET(opt, DOC_HIDDEN))
584 singleOptionHelp(fp, columns, opt, translation_domain);
588 for (opt = table; opt->longName || opt->shortName || opt->arg; opt++) {
589 void * arg = opt->arg;
590 if (poptArgType(opt) != POPT_ARG_INCLUDE_TABLE)
602 if (opt->descrip)
603 POPT_fprintf(fp, "\n%s\n", D_(sub_transdom, opt->descrip));
654 * @param opt option(s)
658 const struct poptOption * opt,
662 const char * argDescrip = getArgDescrip(opt, translation_domain);
664 int prtshort = (int)(isprint((int)opt->shortName) && opt->shortName != ' ');
666 #define prtlong (opt->longName != NULL) /* XXX splint needs a clue */
675 len += (F_ISSET(opt, ONEDASH) ? sizeof("-") : sizeof("--")) - 1;
676 len += strlen(opt->longName);
695 fprintf(fp, "-%c", opt->shortName);
699 (F_ISSET(opt, ONEDASH) ? "-" : "--"),
700 opt->longName);
705 if (!strchr(" =(", argDescrip[0])) fputc(opt->longName == NULL ? ' ' : '=', fp);
729 const struct poptOption * opt;
730 opt = &item->option;
731 if (poptArgType(opt) == POPT_ARG_INTL_DOMAIN) {
732 translation_domain = (const char *)opt->arg;
734 if ((opt->longName || opt->shortName) && !F_ISSET(opt, DOC_HIDDEN)) {
735 columns->cur = singleOptionUsage(fp, columns, opt, translation_domain);
756 * @param opt option(s)
762 const struct poptOption * opt,
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;
771 if (poptArgType(opt) == POPT_ARG_INCLUDE_TABLE) {
772 void * arg = opt->arg;
791 columns->cur = singleTableUsage(con, fp, columns, opt->arg,
794 if ((opt->longName || opt->shortName) && !F_ISSET(opt, DOC_HIDDEN)) {
795 columns->cur = singleOptionUsage(fp, columns, opt, translation_domain);
805 * @param opt option(s)
810 static size_t showShortOptions(const struct poptOption * opt, FILE * fp,
821 if (opt != NULL)
822 for (; (opt->longName || opt->shortName || opt->arg); opt++) {
823 if (!F_ISSET(opt, DOC_HIDDEN) && opt->shortName && !poptArgType(opt))
826 if (!strchr(s, opt->shortName) && isprint((int)opt->shortName)
827 && opt->shortName != ' ')
828 s[strlen(s)] = opt->shortName;
829 } else if (poptArgType(opt) == POPT_ARG_INCLUDE_TABLE) {
830 void * arg = opt->arg;