Lines Matching refs:option
20 static int opterror(const struct option *opt, const char *reason, int flags)
25 fprintf(stderr, " Error: option `no-%s' %s", opt->long_name, reason);
27 fprintf(stderr, " Error: option `%s' %s", opt->long_name, reason);
38 static void optwarning(const struct option *opt, const char *reason, int flags)
43 fprintf(stderr, " Warning: option `no-%s' %s", opt->long_name, reason);
45 fprintf(stderr, " Warning: option `%s' %s", opt->long_name, reason);
48 static int get_arg(struct parse_opt_ctx_t *p, const struct option *opt,
70 const struct option *opt, int flags)
130 * If the option has an optional argument, and the argument is not
131 * provided in the option itself, do not attempt to get it from
134 * This prevents a non-option argument from being interpreted as an
135 * optional argument of a preceding option, for example:
138 * -> is "val" argument of "--opt" or a separate non-option
144 * as having the default value, and "val" as a separate non-option
148 * non-option arguments and want to allow more flexibility in
156 * If next argument is an option or does not exist,
382 static int parse_short_opt(struct parse_opt_ctx_t *p, const struct option *options)
401 const struct option *options)
404 const struct option *abbrev_option = NULL, *ambiguous_option = NULL;
434 * accept the option without "no-" so that users
495 " Error: Ambiguous option: %s (could be --%s%s or --%s%s)\n",
514 static void check_typos(const char *arg, const struct option *options)
549 const struct option *, int,
553 const struct option *options,
560 /* we must reset ->opt, unknown short option leave it dangling */
597 /* fake a short option thing to hide the fact that we may have
670 int parse_options_subcommand(int argc, const char **argv, const struct option *options,
714 astrcatf(&error_buf, "unknown option `%s'",
724 int parse_options(int argc, const char **argv, const struct option *options,
734 static void print_option_help(const struct option *opts, int full)
826 const struct option *a = va, *b = vb;
845 static struct option *options__order(const struct option *opts)
848 const struct option *o = NULL, *p = opts;
849 struct option *opt, *ordered = NULL, *group;
872 /* sort each option group individually */
888 static bool option__in_argv(const struct option *opt, const struct parse_opt_ctx_t *ctx)
920 const struct option *opts, int full,
923 struct option *ordered;
966 const struct option *opts)
973 const struct option *opts, const char *fmt, ...)
990 const struct option *opts,
1032 int parse_opt_verbosity_cb(const struct option *opt,
1055 static struct option *
1056 find_option(struct option *opts, int shortopt, const char *longopt)
1067 void set_option_flag(struct option *opts, int shortopt, const char *longopt,
1070 struct option *opt = find_option(opts, shortopt, longopt);
1077 void set_option_nobuild(struct option *opts, int shortopt,
1082 struct option *opt = find_option(opts, shortopt, longopt);