Lines Matching refs:flags
8 static int opterror(const struct option *opt, const char *reason, int flags) in opterror() argument
10 if (flags & OPT_SHORT) in opterror()
12 if (flags & OPT_UNSET) in opterror()
18 int flags, const char **arg) in get_arg() argument
23 } else if ((opt->flags & PARSE_OPT_LASTARG_DEFAULT) && (p->argc == 1 || in get_arg()
30 return opterror(opt, "requires a value", flags); in get_arg()
35 const struct option *opt, int flags) in get_value() argument
38 const int unset = flags & OPT_UNSET; in get_value()
41 return opterror(opt, "takes no value", flags); in get_value()
42 if (unset && (opt->flags & PARSE_OPT_NONEG)) in get_value()
43 return opterror(opt, "isn't available", flags); in get_value()
45 if (!(flags & OPT_SHORT) && p->opt) { in get_value()
48 if (!(opt->flags & PARSE_OPT_NOARG)) in get_value()
56 return opterror(opt, "takes no value", flags); in get_value()
97 else if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
100 return get_arg(p, opt, flags, (const char **)opt->value); in get_value()
106 if (opt->flags & PARSE_OPT_NOARG) in get_value()
108 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
110 if (get_arg(p, opt, flags, &arg)) in get_value()
119 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
123 if (get_arg(p, opt, flags, &arg)) in get_value()
127 return opterror(opt, "expects a numerical value", flags); in get_value()
135 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
139 if (get_arg(p, opt, flags, &arg)) in get_value()
143 return opterror(opt, "expects a numerical value", flags); in get_value()
151 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
155 if (get_arg(p, opt, flags, &arg)) in get_value()
159 return opterror(opt, "expects a numerical value", flags); in get_value()
167 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
171 if (get_arg(p, opt, flags, &arg)) in get_value()
175 return opterror(opt, "expects a numerical value", flags); in get_value()
209 int flags = 0; in parse_long_opt() local
219 return opterror(options, "takes no value", flags); in parse_long_opt()
239 if (!(flags & OPT_UNSET) && *arg_end) in parse_long_opt()
242 abbrev_flags = flags; in parse_long_opt()
247 flags |= OPT_UNSET; in parse_long_opt()
253 flags |= OPT_UNSET; in parse_long_opt()
266 return get_value(p, options, flags); in parse_long_opt()
303 int argc, const char **argv, int flags) in parse_options_start() argument
309 ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0); in parse_options_start()
310 ctx->flags = flags; in parse_options_start()
311 if ((flags & PARSE_OPT_KEEP_UNKNOWN) && in parse_options_start()
312 (flags & PARSE_OPT_STOP_AT_NON_OPTION)) in parse_options_start()
323 int internal_help = !(ctx->flags & PARSE_OPT_NO_INTERNAL_HELP); in parse_options_step()
332 if (ctx->flags & PARSE_OPT_STOP_AT_NON_OPTION) in parse_options_step()
375 if (!(ctx->flags & PARSE_OPT_KEEP_DASHDASH)) { in parse_options_step()
396 if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN)) in parse_options_step()
412 const char * const usagestr[], int flags) in parse_options() argument
416 parse_options_start(&ctx, argc, argv, flags); in parse_options()
466 if (!full && (opts->flags & PARSE_OPT_HIDDEN)) in usage_with_options_internal()
487 if (opts->flags & PARSE_OPT_OPTARG) in usage_with_options_internal()
496 if (opts->flags & PARSE_OPT_NOARG) in usage_with_options_internal()
501 if (opts->flags & PARSE_OPT_OPTARG) in usage_with_options_internal()
509 if (opts->flags & PARSE_OPT_OPTARG) in usage_with_options_internal()