mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Global: improve support of --help *-format
Also fix some bugs found when refactoring
This commit is contained in:
@@ -75,7 +75,7 @@ void ffPrintBluetooth(FFBluetoothOptions* options)
|
||||
|
||||
void ffInitBluetoothOptions(FFBluetoothOptions* options)
|
||||
{
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_BLUETOOTH_MODULE_NAME, ffParseBluetoothCommandOptions, ffParseBluetoothJsonObject, ffPrintBluetooth, ffGenerateBluetoothJson);
|
||||
ffOptionInitModuleBaseInfo(&options->moduleInfo, FF_BLUETOOTH_MODULE_NAME, ffParseBluetoothCommandOptions, ffParseBluetoothJsonObject, ffPrintBluetooth, ffGenerateBluetoothJson, ffPrintBluetoothHelpFormat);
|
||||
ffOptionInitModuleArg(&options->moduleArgs);
|
||||
options->showDisconnected = false;
|
||||
}
|
||||
@@ -156,3 +156,13 @@ void ffGenerateBluetoothJson(FF_MAYBE_UNUSED FFBluetoothOptions* options, yyjson
|
||||
ffStrbufDestroy(&device->address);
|
||||
}
|
||||
}
|
||||
|
||||
void ffPrintBluetoothHelpFormat(void)
|
||||
{
|
||||
ffPrintModuleFormatHelp(FF_BLUETOOTH_MODULE_NAME, "{1} ({4})", FF_BLUETOOTH_NUM_FORMAT_ARGS, (const char* []) {
|
||||
"Name",
|
||||
"Address",
|
||||
"Type",
|
||||
"Battery percentage"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -10,3 +10,4 @@ bool ffParseBluetoothCommandOptions(FFBluetoothOptions* options, const char* key
|
||||
void ffDestroyBluetoothOptions(FFBluetoothOptions* options);
|
||||
void ffParseBluetoothJsonObject(FFBluetoothOptions* options, yyjson_val* module);
|
||||
void ffGenerateBluetoothJson(FFBluetoothOptions* options, yyjson_mut_doc* doc, yyjson_mut_val* module);
|
||||
void ffPrintBluetoothHelpFormat(void);
|
||||
|
||||
Reference in New Issue
Block a user