Lines Matching refs:flags

9 static int opterror(const struct option *opt, const char *reason, int flags)  in opterror()  argument
11 if (flags & OPT_SHORT) in opterror()
13 if (flags & OPT_UNSET) in opterror()
19 int flags, const char **arg) in get_arg() argument
24 } else if ((opt->flags & PARSE_OPT_LASTARG_DEFAULT) && (p->argc == 1 || in get_arg()
31 return opterror(opt, "requires a value", flags); in get_arg()
36 const struct option *opt, int flags) in get_value() argument
39 const int unset = flags & OPT_UNSET; in get_value()
43 return opterror(opt, "takes no value", flags); in get_value()
44 if (unset && (opt->flags & PARSE_OPT_NONEG)) in get_value()
45 return opterror(opt, "isn't available", flags); in get_value()
46 if (opt->flags & PARSE_OPT_DISABLED) in get_value()
47 return opterror(opt, "is not usable", flags); in get_value()
49 if (opt->flags & PARSE_OPT_EXCLUSIVE) { in get_value()
53 if (((flags & OPT_SHORT) && p->excl_opt->short_name) || in get_value()
61 opterror(opt, msg, flags); in get_value()
66 if (!(flags & OPT_SHORT) && p->opt) { in get_value()
69 if (!(opt->flags & PARSE_OPT_NOARG)) in get_value()
77 return opterror(opt, "takes no value", flags); in get_value()
121 else if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
124 err = get_arg(p, opt, flags, (const char **)opt->value); in get_value()
127 if (opt->flags & PARSE_OPT_NOEMPTY) { in get_value()
145 if (opt->flags & PARSE_OPT_NOARG) in get_value()
147 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
149 if (get_arg(p, opt, flags, &arg)) in get_value()
158 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
162 if (get_arg(p, opt, flags, &arg)) in get_value()
166 return opterror(opt, "expects a numerical value", flags); in get_value()
174 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
178 if (get_arg(p, opt, flags, &arg)) in get_value()
182 return opterror(opt, "expects a numerical value", flags); in get_value()
190 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
194 if (get_arg(p, opt, flags, &arg)) in get_value()
198 return opterror(opt, "expects a numerical value", flags); in get_value()
206 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
210 if (get_arg(p, opt, flags, &arg)) in get_value()
214 return opterror(opt, "expects a numerical value", flags); in get_value()
248 int flags = 0; in parse_long_opt() local
258 return opterror(options, "takes no value", flags); in parse_long_opt()
274 flags |= OPT_UNSET; in parse_long_opt()
279 flags |= OPT_UNSET; in parse_long_opt()
296 if (!(flags & OPT_UNSET) && *arg_end) in parse_long_opt()
299 abbrev_flags = flags; in parse_long_opt()
304 flags |= OPT_UNSET; in parse_long_opt()
310 flags |= OPT_UNSET; in parse_long_opt()
324 return get_value(p, options, flags); in parse_long_opt()
361 int argc, const char **argv, int flags) in parse_options_start() argument
367 ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0); in parse_options_start()
368 ctx->flags = flags; in parse_options_start()
369 if ((flags & PARSE_OPT_KEEP_UNKNOWN) && in parse_options_start()
370 (flags & PARSE_OPT_STOP_AT_NON_OPTION)) in parse_options_start()
381 int internal_help = !(ctx->flags & PARSE_OPT_NO_INTERNAL_HELP); in parse_options_step()
391 if (ctx->flags & PARSE_OPT_STOP_AT_NON_OPTION) in parse_options_step()
439 if (!(ctx->flags & PARSE_OPT_KEEP_DASHDASH)) { in parse_options_step()
468 if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN)) in parse_options_step()
495 const char *const subcommands[], const char *usagestr[], int flags) in parse_options_subcommand() argument
517 parse_options_start(&ctx, argc, argv, flags); in parse_options_subcommand()
551 const char * const usagestr[], int flags) in parse_options() argument
554 (const char **) usagestr, flags); in parse_options()
571 if (!full && (opts->flags & PARSE_OPT_HIDDEN)) in print_option_help()
573 if (opts->flags & PARSE_OPT_DISABLED) in print_option_help()
594 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
603 if (opts->flags & PARSE_OPT_NOARG) in print_option_help()
608 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
616 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
753 opts->flags |= flag; in set_option_flag()