cmdutils: change the signature of the function argument in parse_options()

This is required for a pending simplification.
This commit is contained in:
Stefano Sabatini
2011-06-04 23:54:19 +02:00
parent 0d0fdb0ad5
commit 96f931adf7
5 changed files with 12 additions and 7 deletions

View File

@ -217,7 +217,7 @@ static inline void prepare_app_arguments(int *argc_ptr, char ***argv_ptr)
#endif /* WIN32 && !__MINGW32CE__ */
void parse_options(int argc, char **argv, const OptionDef *options,
void (* parse_arg_function)(const char*))
int (* parse_arg_function)(const char *opt, const char *arg))
{
const char *opt, *arg;
int optindex, handleoptions=1;
@ -284,8 +284,10 @@ unknown_opt:
if(po->flags & OPT_EXIT)
exit(0);
} else {
if (parse_arg_function)
parse_arg_function(opt);
if (parse_arg_function) {
if (parse_arg_function(NULL, opt) < 0)
exit(1);
}
}
}
}