]> git.ipfire.org Git - thirdparty/git.git/commitdiff
parse-options: drop parse_opt_unknown_cb()
authorJeff King <peff@peff.net>
Tue, 28 Mar 2023 20:58:42 +0000 (16:58 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 28 Mar 2023 21:11:24 +0000 (14:11 -0700)
This low-level callback was introduced in ce564eb1bd5 (parse-options:
add parse_opt_unknown_cb(), 2016-09-05) so that we could advertise
--indent-heuristic in git-blame's "-h" output, even though the option is
actually handled in parse_revision_opt(). We later stopped doing so in
44ae131e384 (builtin/blame.c: remove '--indent-heuristic' from usage
string, 2019-10-28).

This is a weird thing to do, and in the intervening years, we've never
used it again. Let's drop the helper in the name of simplicity.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
parse-options-cb.c
parse-options.h

index d346dbe2100ddceb53f8ce149ad4ed794b772f53..4729277aa6936f1ac81567c5e4a3947e8dcae1d7 100644 (file)
@@ -213,21 +213,6 @@ int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset)
        return 0;
 }
 
-/**
- * Report that the option is unknown, so that other code can handle
- * it. This can be used as a callback together with
- * OPTION_LOWLEVEL_CALLBACK to allow an option to be documented in the
- * "-h" output even if it's not being handled directly by
- * parse_options().
- */
-enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
-                                          const struct option *opt,
-                                          const char *arg, int unset)
-{
-       BUG_ON_OPT_ARG(arg);
-       return PARSE_OPT_UNKNOWN;
-}
-
 /**
  * Recreates the command-line option in the strbuf.
  */
index 50d852f2991738c951bb447ce8206640aabb8a80..60b0a758d6b59086f6d52520461a44a2a8516983 100644 (file)
@@ -348,9 +348,6 @@ int parse_opt_commit(const struct option *, const char *, int);
 int parse_opt_tertiary(const struct option *, const char *, int);
 int parse_opt_string_list(const struct option *, const char *, int);
 int parse_opt_noop_cb(const struct option *, const char *, int);
-enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
-                                          const struct option *,
-                                          const char *, int);
 int parse_opt_passthru(const struct option *, const char *, int);
 int parse_opt_passthru_argv(const struct option *, const char *, int);
 /* value is enum branch_track* */