diff --git a/common/include/common/option.h b/common/include/common/option.h index 4f386fca..2aeab2e1 100644 --- a/common/include/common/option.h +++ b/common/include/common/option.h @@ -50,6 +50,7 @@ struct Option char * name; char * description; const char shortopt; + bool preset; enum OptionType type; union diff --git a/common/src/option.c b/common/src/option.c index eb10a102..86222532 100644 --- a/common/src/option.c +++ b/common/src/option.c @@ -663,6 +663,8 @@ void option_print(void) for(int i = 0; i < state.groups[g].count; ++i) { struct Option * o = state.groups[g].options[i]; + if (o->preset) + continue; char * value = o->toString(o); if (!value) { @@ -695,8 +697,10 @@ void option_print(void) for(int i = 0; i < state.groups[g].count; ++i) { struct Option * o = state.groups[g].options[i]; - char * value = stringlist_at(values, i); + if (o->preset) + continue; + char * value = stringlist_at(values, i); len = alloc_sprintf( &line, "%s:%-*s | %c%c | %-*s | %s", @@ -718,6 +722,12 @@ void option_print(void) stringlist_free(&values); + if (stringlist_count(lines) <= 1) + { + stringlist_free(&lines); + continue; + } + // print out the lines for(int i = 0; i < stringlist_count(lines); ++i) {