]> git.ipfire.org Git - thirdparty/git.git/blobdiff - parse-options.h
parse-options: don't emit "ambiguous option" for aliases
[thirdparty/git.git] / parse-options.h
index cc9230adacb61f2a5066ac094c66bdfd18534354..bb49efc2da430ed933d8a2a1f6cdd732f7078ed4 100644 (file)
@@ -7,6 +7,7 @@ enum parse_opt_type {
        OPTION_ARGUMENT,
        OPTION_GROUP,
        OPTION_NUMBER,
+       OPTION_ALIAS,
        /* options with no arguments */
        OPTION_BIT,
        OPTION_NEGBIT,
@@ -183,6 +184,9 @@ struct option {
          N_("no-op (backward compatibility)"),         \
          PARSE_OPT_HIDDEN | PARSE_OPT_NOARG, parse_opt_noop_cb }
 
+#define OPT_ALIAS(s, l, source_long_name) \
+       { OPTION_ALIAS, (s), (l), (source_long_name) }
+
 /*
  * parse_options() will filter out the processed options and leave the
  * non-option arguments in argv[]. argv0 is assumed program name and
@@ -258,6 +262,8 @@ struct parse_opt_ctx_t {
        const char *opt;
        int flags;
        const char *prefix;
+       const char **alias_groups; /* must be in groups of 3 elements! */
+       struct option *updated_options;
 };
 
 void parse_options_start(struct parse_opt_ctx_t *ctx,