From 2f8e586df14649ebf1538dc610928c844e0068ec Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 29 Aug 2011 08:11:03 +0200 Subject: cmdutils: split per-option code out of parse_options(). This allows options like -target, which are just shortcuts for other options, to work without dummy function for all options they invoke. --- cmdutils.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cmdutils.h') diff --git a/cmdutils.h b/cmdutils.h index a4716cad61..f0c9079647 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -151,6 +151,13 @@ void show_help_options(const OptionDef *options, const char *msg, int mask, int void parse_options(void *optctx, int argc, char **argv, const OptionDef *options, void (* parse_arg_function)(void *optctx, const char*)); +/** + * Parse one given option. + * + * @return on success 1 if arg was consumed, 0 otherwise; negative number on error + */ +int parse_option(void *optctx, const char *opt, const char *arg, const OptionDef *options); + /** * Check if the given stream matches a stream specifier. * -- cgit v1.2.3