summaryrefslogtreecommitdiff
path: root/parse-options.h
diff options
context:
space:
mode:
authorStephen Boyd <bebarino@gmail.com>2009-05-23 11:53:12 -0700
committerJunio C Hamano <gitster@pobox.com>2009-05-25 01:07:25 -0700
commit377829201783b8a648e07af6ce7d747e0f45dc19 (patch)
treefe989294bc3d3c8adb2c6d6b8fb7702be7c23acf /parse-options.h
parent3d09e64ac10aab1ae6ae1ac9cce7a6ebb43f2e50 (diff)
downloadgit-377829201783b8a648e07af6ce7d747e0f45dc19.tar.gz
parse-opts: prepare for OPT_FILENAME
To give OPT_FILENAME the prefix, we pass the prefix to parse_options() which passes the prefix to parse_options_start() which sets the prefix member of parse_opts_ctx accordingly. If there isn't a prefix in the calling context, passing NULL will suffice. Signed-off-by: Stephen Boyd <bebarino@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'parse-options.h')
-rw-r--r--parse-options.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse-options.h b/parse-options.h
index fe41ab2c67..f652c0f3c7 100644
--- a/parse-options.h
+++ b/parse-options.h
@@ -122,7 +122,7 @@ struct option {
* non-option arguments in argv[].
* Returns the number of arguments left in argv[].
*/
-extern int parse_options(int argc, const char **argv,
+extern int parse_options(int argc, const char **argv, const char *prefix,
const struct option *options,
const char * const usagestr[], int flags);
@@ -148,13 +148,15 @@ struct parse_opt_ctx_t {
int argc, cpidx;
const char *opt;
int flags;
+ const char *prefix;
};
extern int parse_options_usage(const char * const *usagestr,
const struct option *opts);
extern void parse_options_start(struct parse_opt_ctx_t *ctx,
- int argc, const char **argv, int flags);
+ int argc, const char **argv, const char *prefix,
+ int flags);
extern int parse_options_step(struct parse_opt_ctx_t *ctx,
const struct option *options,