• Home
  • Raw
  • Download

Lines Matching refs:flags

20 static int opterror(const struct option *opt, const char *reason, int flags)  in opterror()  argument
22 if (flags & OPT_SHORT) in opterror()
24 else if (flags & OPT_UNSET) in opterror()
38 static void optwarning(const struct option *opt, const char *reason, int flags) in optwarning() argument
40 if (flags & OPT_SHORT) in optwarning()
42 else if (flags & OPT_UNSET) in optwarning()
49 int flags, const char **arg) in get_arg() argument
56 } else if ((opt->flags & PARSE_OPT_LASTARG_DEFAULT) && (p->argc == 1 || in get_arg()
63 return opterror(opt, "requires a value", flags); in get_arg()
70 const struct option *opt, int flags) in get_value() argument
73 const int unset = flags & OPT_UNSET; in get_value()
77 return opterror(opt, "takes no value", flags); in get_value()
78 if (unset && (opt->flags & PARSE_OPT_NONEG)) in get_value()
79 return opterror(opt, "isn't available", flags); in get_value()
80 if (opt->flags & PARSE_OPT_DISABLED) in get_value()
81 return opterror(opt, "is not usable", flags); in get_value()
83 if (opt->flags & PARSE_OPT_EXCLUSIVE) { in get_value()
87 if (((flags & OPT_SHORT) && p->excl_opt->short_name) || in get_value()
95 opterror(opt, msg, flags); in get_value()
100 if (!(flags & OPT_SHORT) && p->opt) { in get_value()
103 if (!(opt->flags & PARSE_OPT_NOARG)) in get_value()
111 return opterror(opt, "takes no value", flags); in get_value()
126 if (opt->flags & PARSE_OPT_NOBUILD) { in get_value()
131 opt->flags & PARSE_OPT_CANSKIP ? in get_value()
138 strncpy(reason, opt->flags & PARSE_OPT_CANSKIP ? in get_value()
143 if (!(opt->flags & PARSE_OPT_CANSKIP)) in get_value()
144 return opterror(opt, reason, flags); in get_value()
149 if (opt->flags & PARSE_OPT_NOARG) in get_value()
151 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
177 err = get_arg(p, opt, flags, NULL); in get_value()
181 optwarning(opt, reason, flags); in get_value()
215 else if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
218 err = get_arg(p, opt, flags, (const char **)opt->value); in get_value()
224 if (opt->flags & PARSE_OPT_NOEMPTY) { in get_value()
245 if (opt->flags & PARSE_OPT_NOARG) in get_value()
247 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) in get_value()
249 if (get_arg(p, opt, flags, &arg)) in get_value()
258 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
262 if (get_arg(p, opt, flags, &arg)) in get_value()
266 return opterror(opt, "expects a numerical value", flags); in get_value()
274 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
278 if (get_arg(p, opt, flags, &arg)) in get_value()
281 return opterror(opt, "expects an unsigned numerical value", flags); in get_value()
284 return opterror(opt, "expects a numerical value", flags); in get_value()
292 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
296 if (get_arg(p, opt, flags, &arg)) in get_value()
300 return opterror(opt, "expects a numerical value", flags); in get_value()
308 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
312 if (get_arg(p, opt, flags, &arg)) in get_value()
316 return opterror(opt, "expects a numerical value", flags); in get_value()
324 if (opt->flags & PARSE_OPT_OPTARG && !p->opt) { in get_value()
328 if (get_arg(p, opt, flags, &arg)) in get_value()
331 return opterror(opt, "expects an unsigned numerical value", flags); in get_value()
334 return opterror(opt, "expects a numerical value", flags); in get_value()
376 int flags = 0; in parse_long_opt() local
386 return opterror(options, "takes no value", flags); in parse_long_opt()
402 flags |= OPT_UNSET; in parse_long_opt()
407 flags |= OPT_UNSET; in parse_long_opt()
424 if (!(flags & OPT_UNSET) && *arg_end) in parse_long_opt()
427 abbrev_flags = flags; in parse_long_opt()
432 flags |= OPT_UNSET; in parse_long_opt()
438 flags |= OPT_UNSET; in parse_long_opt()
452 return get_value(p, options, flags); in parse_long_opt()
497 int argc, const char **argv, int flags) in parse_options_start() argument
503 ctx->cpidx = ((flags & PARSE_OPT_KEEP_ARGV0) != 0); in parse_options_start()
504 ctx->flags = flags; in parse_options_start()
505 if ((flags & PARSE_OPT_KEEP_UNKNOWN) && in parse_options_start()
506 (flags & PARSE_OPT_STOP_AT_NON_OPTION)) in parse_options_start()
518 int internal_help = !(ctx->flags & PARSE_OPT_NO_INTERNAL_HELP); in parse_options_step()
528 if (ctx->flags & PARSE_OPT_STOP_AT_NON_OPTION) in parse_options_step()
577 if (!(ctx->flags & PARSE_OPT_KEEP_DASHDASH)) { in parse_options_step()
606 if (!(ctx->flags & PARSE_OPT_KEEP_UNKNOWN)) in parse_options_step()
633 const char *const subcommands[], const char *usagestr[], int flags) in parse_options_subcommand() argument
653 parse_options_start(&ctx, argc, argv, flags); in parse_options_subcommand()
687 const char * const usagestr[], int flags) in parse_options() argument
690 (const char **) usagestr, flags); in parse_options()
707 if (!full && (opts->flags & PARSE_OPT_HIDDEN)) in print_option_help()
709 if (opts->flags & PARSE_OPT_DISABLED) in print_option_help()
731 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
740 if (opts->flags & PARSE_OPT_NOARG) in print_option_help()
745 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
753 if (opts->flags & PARSE_OPT_OPTARG) in print_option_help()
780 if (opts->flags & PARSE_OPT_NOBUILD) in print_option_help()
1034 opt->flags |= flag; in set_option_flag()
1048 opt->flags |= PARSE_OPT_NOBUILD; in set_option_nobuild()
1049 opt->flags |= can_skip ? PARSE_OPT_CANSKIP : 0; in set_option_nobuild()