[common] track if option set failed and print help if so

This commit is contained in:
Geoffrey McRae
2019-05-12 16:51:37 +10:00
parent b662128708
commit 2fe9dc7ca1
3 changed files with 41 additions and 27 deletions

View File

@@ -51,7 +51,11 @@ struct Option
bool (*validator)(struct Option * opt, const char ** error);
char * (*toString )(struct Option * opt);
StringList (*getValues)(struct Option * opt);
void (*printHelp)();
void (*printHelp)();
// internal use only
bool failed_set;
};
// register an NULL terminated array of options