Global: support for named format arguments

Fix #796
This commit is contained in:
Carter Li
2024-05-27 16:41:37 +08:00
parent 965777323e
commit c8451cab52
65 changed files with 855 additions and 806 deletions
+11 -11
View File
@@ -44,7 +44,7 @@ void ffPrintBios(FFBiosOptions* options)
{
ffStrbufClear(&key);
FF_PARSE_FORMAT_STRING_CHECKED(&key, &options->moduleArgs.key, 1, ((FFformatarg[]){
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.type},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.type, "type"},
}));
}
@@ -60,11 +60,11 @@ void ffPrintBios(FFBiosOptions* options)
else
{
FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_BIOS_NUM_FORMAT_ARGS, ((FFformatarg[]) {
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.date},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.release},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.vendor},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.version},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.type},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.date, "date"},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.release, "release"},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.vendor, "vendor"},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.version, "version"},
{FF_FORMAT_ARG_TYPE_STRBUF, &bios.type, "type"},
}));
}
@@ -146,11 +146,11 @@ exit:
void ffPrintBiosHelpFormat(void)
{
FF_PRINT_MODULE_FORMAT_HELP_CHECKED(FF_BIOS_MODULE_NAME, "{4} ({2})", FF_BIOS_NUM_FORMAT_ARGS, ((const char* []) {
"bios date",
"bios release",
"bios vendor",
"bios version",
"firmware type",
"bios date - date",
"bios release - release",
"bios vendor - vendor",
"bios version - version",
"firmware type - type",
}));
}