[common] add getValues callback for options

This commit is contained in:
Geoffrey McRae committed 2019-05-12 16:13:50 +10:00
1 parent 5d69d2aba9
commit e22f33a44b
4 files changed
+19 -8

No files matched your search

+9
View File
@@ -464,6 +464,15 @@ bool option_validate()
if (error)
printf("\n Error: %s\n", error);
if (o->getValues)
{
StringList values = o->getValues(o);
printf("\nValid values are:\n\n");
for(unsigned int v = 0; v < stringlist_count(values); ++v)
printf(" * %s\n", stringlist_at(values, v));
stringlist_free(&values);
}
if (o->printHelp)
{
printf("\n");