Lines Matching refs:opt

95     const struct poptOption *opt;
98 for (opt = table; opt->longName || opt->shortName || opt->arg; opt++) {
99 if (opt->argInfo == POPT_ARG_INTL_DOMAIN)
100 return opt->arg;
106 * @param opt option(s)
110 getArgDescrip(const struct poptOption * opt,
116 if (!(opt->argInfo & POPT_ARG_MASK)) return NULL;
118 if (opt == (poptHelpOptions + 1) || opt == (poptHelpOptions + 2))
119 if (opt->argDescrip) return POPT_(opt->argDescrip);
121 if (opt->argDescrip) return D_(translation_domain, opt->argDescrip);
123 switch (opt->argInfo & POPT_ARG_MASK) {
142 * @param opt option(s)
148 const struct poptOption * opt,
165 if (opt->arg) /* XXX programmer error */
166 switch (opt->argInfo & POPT_ARG_MASK) {
169 { long aLong = *((int *)opt->arg);
173 { long aLong = *((long *)opt->arg);
177 { double aDouble = *((float *)opt->arg);
181 { double aDouble = *((double *)opt->arg);
185 { const char * s = *(const char **)opt->arg;
215 * @param opt option(s)
219 const struct poptOption * opt,
226 const char * help = D_(translation_domain, opt->descrip);
227 const char * argDescrip = getArgDescrip(opt, translation_domain);
235 if (opt->longName) nb += strlen(opt->longName);
244 if (opt->longName && opt->shortName)
245 sprintf(left, "-%c, %s%s", opt->shortName,
246 ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? "-" : "--"),
247 opt->longName);
248 else if (opt->shortName != '\0')
249 sprintf(left, "-%c", opt->shortName);
250 else if (opt->longName)
252 ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? "-" : "--"),
253 opt->longName);
259 if (opt->argInfo & POPT_ARGFLAG_OPTIONAL)
264 if (opt->argInfo & POPT_ARGFLAG_SHOW_DEFAULT) {
265 defs = singleOptionDefaultValue(lineLength, opt, translation_domain);
284 if (opt->argDescrip == NULL) {
285 switch (opt->argInfo & POPT_ARG_MASK) {
290 { long aLong = opt->val;
291 int ops = (opt->argInfo & POPT_ARGFLAG_LOGICALOPS);
292 int negate = (opt->argInfo & POPT_ARGFLAG_NOT);
311 *le++ = (opt->longName != NULL ? '=' : ' ');
325 *le++ = (opt->longName != NULL ? '=' : ' ');
352 if (opt->argInfo & POPT_ARGFLAG_OPTIONAL)
406 * @param opt option(s)
410 static size_t maxArgWidth(const struct poptOption * opt,
418 if (opt != NULL)
419 while (opt->longName || opt->shortName || opt->arg) {
420 if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) {
421 if (opt->arg) /* XXX program error */
422 len = maxArgWidth(opt->arg, translation_domain);
424 } else if (!(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) {
426 if (opt->shortName != '\0') len += sizeof("-X")-1;
427 if (opt->shortName != '\0' && opt->longName) len += sizeof(", ")-1;
428 if (opt->longName) {
429 len += ((opt->argInfo & POPT_ARGFLAG_ONEDASH)
431 len += strlen(opt->longName);
434 s = getArgDescrip(opt, translation_domain);
455 if (opt->argInfo & POPT_ARGFLAG_OPTIONAL) len += sizeof("[]")-1;
459 opt++;
484 const struct poptOption * opt;
485 opt = &item->option;
486 if ((opt->longName || opt->shortName) &&
487 !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN))
488 singleOptionHelp(fp, left, opt, translation_domain);
506 const struct poptOption * opt;
516 for (opt = table; (opt->longName || opt->shortName || opt->arg); opt++) {
517 if ((opt->longName || opt->shortName) &&
518 !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN))
519 singleOptionHelp(fp, left, opt, translation_domain);
523 for (opt = table; (opt->longName || opt->shortName || opt->arg); opt++) {
524 if ((opt->argInfo & POPT_ARG_MASK) != POPT_ARG_INCLUDE_TABLE)
526 sub_transdom = getTableTranslationDomain(opt->arg);
530 if (opt->descrip)
531 fprintf(fp, "\n%s\n", D_(sub_transdom, opt->descrip));
533 singleTableHelp(con, fp, opt->arg, left, sub_transdom);
582 * @param opt option(s)
586 const struct poptOption * opt,
594 const char * argDescrip = getArgDescrip(opt, translation_domain);
596 if (opt->shortName != '\0' && opt->longName != NULL) {
598 if (!(opt->argInfo & POPT_ARGFLAG_ONEDASH)) len++;
599 len += strlen(opt->longName);
600 } else if (opt->shortName != '\0') {
602 shortStr[0] = opt->shortName;
604 } else if (opt->longName) {
605 len += strlen(opt->longName);
606 if (!(opt->argInfo & POPT_ARGFLAG_ONEDASH)) len++;
607 item = opt->longName;
636 if (opt->longName && opt->shortName) {
638 opt->shortName, ((opt->argInfo & POPT_ARGFLAG_ONEDASH) ? "" : "-"),
639 opt->longName,
644 ((opt->shortName || (opt->argInfo & POPT_ARGFLAG_ONEDASH)) ? "" : "-"),
646 (argDescrip ? (opt->shortName != '\0' ? " " : "=") : ""),
672 const struct poptOption * opt;
673 opt = &item->option;
674 if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INTL_DOMAIN) {
675 translation_domain = (const char *)opt->arg;
676 } else if ((opt->longName || opt->shortName) &&
677 !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) {
678 cursor = singleOptionUsage(fp, cursor, opt, translation_domain);
700 * @param opt option(s)
706 /*@null@*/ const struct poptOption * opt,
713 if (opt != NULL)
714 for (; (opt->longName || opt->shortName || opt->arg) ; opt++) {
715 if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INTL_DOMAIN) {
716 translation_domain = (const char *)opt->arg;
717 } else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) {
724 if (that == NULL || that != opt->arg)
729 if (opt->arg == NULL || i < done->nopts)
733 done->opts[done->nopts++] = (const void *) opt->arg;
736 cursor = singleTableUsage(con, fp, cursor, opt->arg,
738 } else if ((opt->longName || opt->shortName) &&
739 !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) {
740 cursor = singleOptionUsage(fp, cursor, opt, translation_domain);
751 * @param opt option(s)
756 static int showShortOptions(const struct poptOption * opt, FILE * fp,
767 if (opt != NULL)
768 for (; (opt->longName || opt->shortName || opt->arg); opt++) {
769 if (opt->shortName && !(opt->argInfo & POPT_ARG_MASK))
770 s[strlen(s)] = opt->shortName;
771 else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE)
772 if (opt->arg) /* XXX program error */
773 len = showShortOptions(opt->arg, fp, s);