Lines Matching refs:flags

12 static int opterror(const struct option *opt, const char *reason, int flags)  in opterror()  argument
14 if (flags & OPT_SHORT) in opterror()
16 if (flags & OPT_UNSET) in opterror()
22 int flags, const char **arg) in get_arg() argument
27 } else if ((opt->flags & PARSE_OPT_LASTARG_DEFAULT) && (p->argc == 1 || in get_arg()
34 return opterror(opt, "requires a value", flags); in get_arg()
39 const struct option *opt, int flags) in get_value() argument
42 const int unset = flags & OPT_UNSET; in get_value()
46 return opterror(opt, "takes no value", flags); in get_value()
47 if (unset && (opt->flags & PARSE_OPT_NONEG)) in get_value()
48 return opterror(opt, "isn't available", flags); in get_value()
49 if (opt->flags & PARSE_OPT_DISABLED) in get_value()
50 return opterror(opt, "is not usable", flags); in get_value()
52 if (opt->flags & PARSE_OPT_EXCLUSIVE) { in get_value()
56 if (((flags & OPT_SHORT) && p->excl_opt->short_name) || in get_value()
64 opterror(opt, msg, flags); in get_value()
69 if (!(flags & OPT_SHORT) && p->opt) { in get_value()
72 if (!(opt->flags & PARSE_OPT_NOARG)) in get_value()
80 return opterror(opt, "takes no value", flags); in get_value()
124 else if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
127 err = get_arg(p, opt, flags, (const char **)opt->value); in get_value()
130 if (opt->flags & PARSE_OPT_NOEMPTY) { in get_value()
148 if (opt->flags & PARSE_OPT_NOARG) in get_value()
150 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
152 if (get_arg(p, opt, flags, &arg)) in get_value()
161 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
165 if (get_arg(p, opt, flags, &arg)) in get_value()
169 return opterror(opt, "expects a numerical value", flags); in get_value()
177 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
181 if (get_arg(p, opt, flags, &arg)) in get_value()
185 return opterror(opt, "expects a numerical value", flags); in get_value()
193 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
197 if (get_arg(p, opt, flags, &arg)) in get_value()
201 return opterror(opt, "expects a numerical value", flags); in get_value()
209 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
213 if (get_arg(p, opt, flags, &arg)) in get_value()
217 return opterror(opt, "expects a numerical value", flags); in get_value()
251 int flags = 0; in parse_long_opt() local
261 return opterror(options, "takes no value", flags); in parse_long_opt()
277 flags |= OPT_UNSET; in parse_long_opt()
282 flags |= OPT_UNSET; in parse_long_opt()
299 if (!(flags & OPT_UNSET) && *arg_end) in parse_long_opt()
302 abbrev_flags = flags; in parse_long_opt()
307 flags |= OPT_UNSET; in parse_long_opt()
313 flags |= OPT_UNSET; in parse_long_opt()
327 return get_value(p, options, flags); in parse_long_opt()
364 int argc, const char **argv, int flags) in parse_options_start() argument
370 ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0); in parse_options_start()
371 ctx->flags = flags; in parse_options_start()
372 if ((flags & PARSE_OPT_KEEP_UNKNOWN) && in parse_options_start()
373 (flags & PARSE_OPT_STOP_AT_NON_OPTION)) in parse_options_start()
385 int internal_help = !(ctx->flags & PARSE_OPT_NO_INTERNAL_HELP); in parse_options_step()
395 if (ctx->flags & PARSE_OPT_STOP_AT_NON_OPTION) in parse_options_step()
444 if (!(ctx->flags & PARSE_OPT_KEEP_DASHDASH)) { in parse_options_step()
473 if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN)) in parse_options_step()
500 const char *const subcommands[], const char *usagestr[], int flags) in parse_options_subcommand() argument
522 parse_options_start(&ctx, argc, argv, flags); in parse_options_subcommand()
558 const char * const usagestr[], int flags) in parse_options() argument
561 (const char **) usagestr, flags); in parse_options()
578 if (!full && (opts->flags & PARSE_OPT_HIDDEN)) in print_option_help()
580 if (opts->flags & PARSE_OPT_DISABLED) in print_option_help()
601 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
610 if (opts->flags & PARSE_OPT_NOARG) in print_option_help()
615 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
623 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
863 opts->flags |= flag; in set_option_flag()