summaryrefslogtreecommitdiff
path: root/parse-options.c
diff options
context:
space:
mode:
authorDmitry Ivankov <divanorama@gmail.com>2011-08-11 09:15:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-08-11 19:18:02 (GMT)
commit1f275b7c4caebf8ca5c002458f0f1b7994548a97 (patch)
tree8aff642fb1457e433f58afc3d89695a9dcfe18c4 /parse-options.c
parent1421fd9df4f1e3ed232bd1c683c6e264a464a41e (diff)
downloadgit-1f275b7c4caebf8ca5c002458f0f1b7994548a97.zip
git-1f275b7c4caebf8ca5c002458f0f1b7994548a97.tar.gz
git-1f275b7c4caebf8ca5c002458f0f1b7994548a97.tar.bz2
parse-options: export opterr, optbug
opterror and optbug functions are used by some of parsing routines in parse-options.c to report errors and bugs respectively. Export these functions to allow more custom parsing routines to use them in a uniform way. Signed-off-by: Dmitry Ivankov <divanorama@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.c')
-rw-r--r--parse-options.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse-options.c b/parse-options.c
index 879ea82..7b061af 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -12,14 +12,14 @@ static int parse_options_usage(struct parse_opt_ctx_t *ctx,
#define OPT_SHORT 1
#define OPT_UNSET 2
-static int optbug(const struct option *opt, const char *reason)
+int optbug(const struct option *opt, const char *reason)
{
if (opt->long_name)
return error("BUG: option '%s' %s", opt->long_name, reason);
return error("BUG: switch '%c' %s", opt->short_name, reason);
}
-static int opterror(const struct option *opt, const char *reason, int flags)
+int opterror(const struct option *opt, const char *reason, int flags)
{
if (flags & OPT_SHORT)
return error("switch `%c' %s", opt->short_name, reason);