summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1421fd9)
raw | patch | inline | side by side (parent: 1421fd9)
author | Dmitry Ivankov <divanorama@gmail.com> | |
Thu, 11 Aug 2011 09:15:37 +0000 (15:15 +0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 11 Aug 2011 19:18:02 +0000 (12:18 -0700) |
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>
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>
parse-options.c | patch | blob | history | |
parse-options.h | patch | blob | history |
diff --git a/parse-options.c b/parse-options.c
index 879ea82a3158ca5e6d4ca397e0c2dd2265e15edc..7b061afcdc1113601a36b14ce3f98044d47073ca 100644 (file)
--- a/parse-options.c
+++ b/parse-options.c
#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);
diff --git a/parse-options.h b/parse-options.h
index 05eb09b878fd94cfcc549622a35a0b897fa56cb9..59e0b524bdcbe1c061f49b8e5f3c6365a9f2eba4 100644 (file)
--- a/parse-options.h
+++ b/parse-options.h
const char * const *usagestr,
const struct option *options);
+extern int optbug(const struct option *opt, const char *reason);
+extern int opterror(const struct option *opt, const char *reason, int flags);
/*----- incremental advanced APIs -----*/
enum {