Skip to content

Commit

Permalink
parse-options: inline parse_options_usage() at its only remaining caller
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Jeff King <peff@peff.net>
  • Loading branch information
René Scharfe authored and Jeff King committed Nov 20, 2015
1 parent ac20ff6 commit d3d1f8c
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions parse-options.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
#include "color.h"
#include "utf8.h"

static int parse_options_usage(struct parse_opt_ctx_t *ctx,
const char * const *usagestr,
const struct option *opts, int err);

#define OPT_SHORT 1
#define OPT_UNSET 2

Expand Down Expand Up @@ -516,7 +512,7 @@ int parse_options_step(struct parse_opt_ctx_t *ctx,
show_usage_error:
err = 1;
show_usage:
return parse_options_usage(ctx, usagestr, options, err);
return usage_with_options_internal(ctx, usagestr, options, 0, err);
}

int parse_options_end(struct parse_opt_ctx_t *ctx)
Expand Down Expand Up @@ -662,13 +658,6 @@ void NORETURN usage_msg_opt(const char *msg,
usage_with_options(usagestr, options);
}

static int parse_options_usage(struct parse_opt_ctx_t *ctx,
const char * const *usagestr,
const struct option *opts, int err)
{
return usage_with_options_internal(ctx, usagestr, opts, 0, err);
}

#undef opterror
int opterror(const struct option *opt, const char *reason, int flags)
{
Expand Down

0 comments on commit d3d1f8c

Please sign in to comment.