Skip to content

Commit 4a4d970

Browse files
peffgitster
authored andcommitted
parse-options: drop parse_opt_unknown_cb()
This low-level callback was introduced in ce564eb (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 44ae131 (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 126e3b3 commit 4a4d970

File tree

2 files changed

+0
-18
lines changed

2 files changed

+0
-18
lines changed

parse-options-cb.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -213,21 +213,6 @@ int parse_opt_noop_cb(const struct option *opt, const char *arg, int unset)
213213
return 0;
214214
}
215215

216-
/**
217-
* Report that the option is unknown, so that other code can handle
218-
* it. This can be used as a callback together with
219-
* OPTION_LOWLEVEL_CALLBACK to allow an option to be documented in the
220-
* "-h" output even if it's not being handled directly by
221-
* parse_options().
222-
*/
223-
enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
224-
const struct option *opt,
225-
const char *arg, int unset)
226-
{
227-
BUG_ON_OPT_ARG(arg);
228-
return PARSE_OPT_UNKNOWN;
229-
}
230-
231216
/**
232217
* Recreates the command-line option in the strbuf.
233218
*/

parse-options.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,6 @@ int parse_opt_commit(const struct option *, const char *, int);
348348
int parse_opt_tertiary(const struct option *, const char *, int);
349349
int parse_opt_string_list(const struct option *, const char *, int);
350350
int parse_opt_noop_cb(const struct option *, const char *, int);
351-
enum parse_opt_result parse_opt_unknown_cb(struct parse_opt_ctx_t *ctx,
352-
const struct option *,
353-
const char *, int);
354351
int parse_opt_passthru(const struct option *, const char *, int);
355352
int parse_opt_passthru_argv(const struct option *, const char *, int);
356353
/* value is enum branch_track* */

0 commit comments

Comments
 (0)