#include "git-compat-util.h"
#include "parse-options.h"
#include "abspath.h"
#include "parse.h"
#include "gettext.h"
#include "strbuf.h"
#include "string-list.h"
#include "utf8.h"
static int disallow_abbreviated_options;
enum opt_parsed { … };
static void optbug(const struct option *opt, const char *reason)
{ … }
static const char *optname(const struct option *opt, enum opt_parsed flags)
{ … }
static enum parse_opt_result get_arg(struct parse_opt_ctx_t *p,
const struct option *opt,
enum opt_parsed flags, const char **arg)
{ … }
static char *fix_filename(const char *prefix, const char *file)
{ … }
static enum parse_opt_result do_get_value(struct parse_opt_ctx_t *p,
const struct option *opt,
enum opt_parsed flags,
const char **argp)
{ … }
struct parse_opt_cmdmode_list { … };
static void build_cmdmode_list(struct parse_opt_ctx_t *ctx,
const struct option *opts)
{ … }
static char *optnamearg(const struct option *opt, const char *arg,
enum opt_parsed flags)
{ … }
static enum parse_opt_result get_value(struct parse_opt_ctx_t *p,
const struct option *opt,
enum opt_parsed flags)
{ … }
static enum parse_opt_result parse_short_opt(struct parse_opt_ctx_t *p,
const struct option *options)
{ … }
static int has_string(const char *it, const char **array)
{ … }
static int is_alias(struct parse_opt_ctx_t *ctx,
const struct option *one_opt,
const struct option *another_opt)
{ … }
struct parsed_option { … };
static void register_abbrev(struct parse_opt_ctx_t *p,
const struct option *option, enum opt_parsed flags,
struct parsed_option *abbrev,
struct parsed_option *ambiguous)
{ … }
static enum parse_opt_result parse_long_opt(
struct parse_opt_ctx_t *p, const char *arg,
const struct option *options)
{ … }
static enum parse_opt_result parse_nodash_opt(struct parse_opt_ctx_t *p,
const char *arg,
const struct option *options)
{ … }
static enum parse_opt_result parse_subcommand(const char *arg,
const struct option *options)
{ … }
static void check_typos(const char *arg, const struct option *options)
{ … }
static void parse_options_check(const struct option *opts)
{ … }
static int has_subcommands(const struct option *options)
{ … }
static void parse_options_start_1(struct parse_opt_ctx_t *ctx,
int argc, const char **argv, const char *prefix,
const struct option *options,
enum parse_opt_flags flags)
{ … }
void parse_options_start(struct parse_opt_ctx_t *ctx,
int argc, const char **argv, const char *prefix,
const struct option *options,
enum parse_opt_flags flags)
{ … }
static void show_negated_gitcomp(const struct option *opts, int show_all,
int nr_noopts)
{ … }
static int show_gitcomp(const struct option *opts, int show_all)
{ … }
static struct option *preprocess_options(struct parse_opt_ctx_t *ctx,
const struct option *options)
{ … }
static void free_preprocessed_options(struct option *options)
{ … }
static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t *,
const char * const *,
const struct option *,
int, int);
enum parse_opt_result parse_options_step(struct parse_opt_ctx_t *ctx,
const struct option *options,
const char * const usagestr[])
{ … }
int parse_options_end(struct parse_opt_ctx_t *ctx)
{ … }
int parse_options(int argc, const char **argv,
const char *prefix,
const struct option *options,
const char * const usagestr[],
enum parse_opt_flags flags)
{ … }
static int usage_argh(const struct option *opts, FILE *outfile)
{ … }
static int usage_indent(FILE *outfile)
{ … }
#define USAGE_OPTS_WIDTH …
static void usage_padding(FILE *outfile, size_t pos)
{ … }
static const struct option *find_option_by_long_name(const struct option *opts,
const char *long_name)
{ … }
static enum parse_opt_result usage_with_options_internal(struct parse_opt_ctx_t *ctx,
const char * const *usagestr,
const struct option *opts,
int full, int err)
{ … }
void NORETURN usage_with_options(const char * const *usagestr,
const struct option *opts)
{ … }
void NORETURN usage_msg_opt(const char *msg,
const char * const *usagestr,
const struct option *options)
{ … }
void NORETURN usage_msg_optf(const char * const fmt,
const char * const *usagestr,
const struct option *options, ...)
{ … }
void die_for_incompatible_opt4(int opt1, const char *opt1_name,
int opt2, const char *opt2_name,
int opt3, const char *opt3_name,
int opt4, const char *opt4_name)
{ … }