Remove command-line option inconsistencies

Optional arguments, as parsed by the getopt_long mechanism, are
inherently inconsistent with how you define required arguments.

To avoid confusion we decide to avoid this inconsistency by replacing
optional options with additional options with required argmuments.
This commit is contained in:
Martin Lund 2022-06-04 19:07:11 +02:00
parent 8d2ad8d82d
commit 9476422922
6 changed files with 103 additions and 59 deletions

View file

@ -144,6 +144,13 @@ static int data_handler(void *user, const char *section, const char *name,
}
}
else if (!strcmp(name, "timestamp"))
{
if (!strcmp(value, "enable"))
{
option.timestamp = TIMESTAMP_24HOUR;
}
}
else if (!strcmp(name, "timestamp-format"))
{
option.timestamp = timestamp_option_parse(value);
}