diff --git a/src/modules/battery/battery.c b/src/modules/battery/battery.c index 013b9a695..c40f7a629 100644 --- a/src/modules/battery/battery.c +++ b/src/modules/battery/battery.c @@ -97,11 +97,14 @@ static void printBattery(FFBatteryOptions* options, FFBatteryResult* result, uin else { FF_STRBUF_AUTO_DESTROY capacityNum = ffStrbufCreate(); - ffPercentAppendNum(&capacityNum, result->capacity, options->percent, false, &options->moduleArgs); + if(percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&capacityNum, result->capacity, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY capacityBar = ffStrbufCreate(); - ffPercentAppendBar(&capacityBar, result->capacity, options->percent, &options->moduleArgs); + if(percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&capacityBar, result->capacity, options->percent, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate(); ffTempsAppendNum(result->temperature, &tempStr, options->tempConfig, &options->moduleArgs); + FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, FF_BATTERY_NUM_FORMAT_ARGS, ((FFformatarg[]) { FF_FORMAT_ARG(result->manufacturer, "manufacturer"), FF_FORMAT_ARG(result->modelName, "model-name"), diff --git a/src/modules/bluetooth/bluetooth.c b/src/modules/bluetooth/bluetooth.c index bd07ab0d3..0116ce236 100644 --- a/src/modules/bluetooth/bluetooth.c +++ b/src/modules/bluetooth/bluetooth.c @@ -9,13 +9,13 @@ static void printDevice(FFBluetoothOptions* options, const FFBluetoothResult* device, uint8_t index) { + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_BLUETOOTH_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); bool showBatteryLevel = device->battery > 0 && device->battery <= 100; - FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if (showBatteryLevel && (percentType & FF_PERCENTAGE_TYPE_BAR_BIT)) { @@ -41,9 +41,11 @@ static void printDevice(FFBluetoothOptions* options, const FFBluetoothResult* de else { FF_STRBUF_AUTO_DESTROY percentageNum = ffStrbufCreate(); - ffPercentAppendNum(&percentageNum, device->battery, options->percent, false, &options->moduleArgs); + if(percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&percentageNum, device->battery, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY percentageBar = ffStrbufCreate(); - ffPercentAppendBar(&percentageBar, device->battery, options->percent, &options->moduleArgs); + if(percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&percentageBar, device->battery, options->percent, &options->moduleArgs); FF_PRINT_FORMAT_CHECKED(FF_BLUETOOTH_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_BLUETOOTH_NUM_FORMAT_ARGS, ((FFformatarg[]) { FF_FORMAT_ARG(device->name, "name"), diff --git a/src/modules/brightness/brightness.c b/src/modules/brightness/brightness.c index bc06b68ba..dc7e2f455 100644 --- a/src/modules/brightness/brightness.c +++ b/src/modules/brightness/brightness.c @@ -89,16 +89,19 @@ void ffPrintBrightness(FFBrightnessOptions* options) else { FF_STRBUF_AUTO_DESTROY valueNum = ffStrbufCreate(); - ffPercentAppendNum(&valueNum, percent, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&valueNum, percent, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY valueBar = ffStrbufCreate(); - ffPercentAppendBar(&valueBar, percent, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&valueBar, percent, options->percent, &options->moduleArgs); + FF_PRINT_FORMAT_CHECKED(key.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, FF_BRIGHTNESS_NUM_FORMAT_ARGS, ((FFformatarg[]) { FF_FORMAT_ARG(valueNum, "percentage"), FF_FORMAT_ARG(item->name, "name"), FF_FORMAT_ARG(item->max, "max"), FF_FORMAT_ARG(item->min, "min"), FF_FORMAT_ARG(item->current, "current"), - FF_FORMAT_ARG(item->current, "percentage-bar"), + FF_FORMAT_ARG(valueBar, "percentage-bar"), })); } diff --git a/src/modules/btrfs/btrfs.c b/src/modules/btrfs/btrfs.c index 7054e8139..e295a2a26 100644 --- a/src/modules/btrfs/btrfs.c +++ b/src/modules/btrfs/btrfs.c @@ -45,6 +45,8 @@ static void printBtrfs(FFBtrfsOptions* options, FFBtrfsResult* result, uint8_t i double usedPercentage = total > 0 ? (double) used / (double) total * 100.0 : 0; double allocatedPercentage = total > 0 ? (double) allocated / (double) total * 100.0 : 0; + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; + if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(buffer.chars, index, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY); @@ -60,14 +62,18 @@ static void printBtrfs(FFBtrfsOptions* options, FFBtrfsResult* result, uint8_t i else { FF_STRBUF_AUTO_DESTROY usedPercentageNum = ffStrbufCreate(); - ffPercentAppendNum(&usedPercentageNum, usedPercentage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&usedPercentageNum, usedPercentage, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY usedPercentageBar = ffStrbufCreate(); - ffPercentAppendBar(&usedPercentageBar, usedPercentage, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&usedPercentageBar, usedPercentage, options->percent, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY allocatedPercentageNum = ffStrbufCreate(); - ffPercentAppendNum(&allocatedPercentageNum, allocatedPercentage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&allocatedPercentageNum, allocatedPercentage, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY allocatedPercentageBar = ffStrbufCreate(); - ffPercentAppendBar(&allocatedPercentageBar, allocatedPercentage, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&allocatedPercentageBar, allocatedPercentage, options->percent, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY nodeSizePretty = ffStrbufCreate(); ffParseSize(result->nodeSize, &nodeSizePretty); diff --git a/src/modules/cpuusage/cpuusage.c b/src/modules/cpuusage/cpuusage.c index 1fc7490c6..a224517c6 100644 --- a/src/modules/cpuusage/cpuusage.c +++ b/src/modules/cpuusage/cpuusage.c @@ -76,17 +76,24 @@ void ffPrintCPUUsage(FFCPUUsageOptions* options) else { FF_STRBUF_AUTO_DESTROY avgNum = ffStrbufCreate(); - ffPercentAppendNum(&avgNum, avgValue, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&avgNum, avgValue, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY avgBar = ffStrbufCreate(); - ffPercentAppendBar(&avgBar, avgValue, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&avgBar, avgValue, options->percent, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY minNum = ffStrbufCreate(); - ffPercentAppendNum(&minNum, minValue, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&minNum, minValue, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY minBar = ffStrbufCreate(); - ffPercentAppendBar(&minBar, minValue, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&minBar, minValue, options->percent, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY maxNum = ffStrbufCreate(); - ffPercentAppendNum(&maxNum, maxValue, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&maxNum, maxValue, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY maxBar = ffStrbufCreate(); - ffPercentAppendBar(&maxBar, maxValue, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&maxBar, maxValue, options->percent, &options->moduleArgs); + FF_PRINT_FORMAT_CHECKED(FF_CPUUSAGE_DISPLAY_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_CPUUSAGE_NUM_FORMAT_ARGS, ((FFformatarg[]){ FF_FORMAT_ARG(avgNum, "avg"), FF_FORMAT_ARG(maxNum, "max"), diff --git a/src/modules/disk/disk.c b/src/modules/disk/disk.c index b47c2bb0a..a095d8c59 100644 --- a/src/modules/disk/disk.c +++ b/src/modules/disk/disk.c @@ -108,15 +108,19 @@ static void printDisk(FFDiskOptions* options, const FFDisk* disk, uint32_t index else { FF_STRBUF_AUTO_DESTROY bytesPercentageNum = ffStrbufCreate(); - ffPercentAppendNum(&bytesPercentageNum, bytesPercentage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&bytesPercentageNum, bytesPercentage, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY bytesPercentageBar = ffStrbufCreate(); - ffPercentAppendBar(&bytesPercentageBar, bytesPercentage, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&bytesPercentageBar, bytesPercentage, options->percent, &options->moduleArgs); double filesPercentage = disk->filesTotal > 0 ? ((double) disk->filesUsed / (double) disk->filesTotal) * 100.0 : 0; FF_STRBUF_AUTO_DESTROY filesPercentageNum = ffStrbufCreate(); - ffPercentAppendNum(&filesPercentageNum, filesPercentage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&filesPercentageNum, filesPercentage, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY filesPercentageBar = ffStrbufCreate(); - ffPercentAppendBar(&filesPercentageBar, filesPercentage, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&filesPercentageBar, filesPercentage, options->percent, &options->moduleArgs); bool isExternal = !!(disk->type & FF_DISK_VOLUME_TYPE_EXTERNAL_BIT); bool isHidden = !!(disk->type & FF_DISK_VOLUME_TYPE_HIDDEN_BIT); diff --git a/src/modules/gamepad/gamepad.c b/src/modules/gamepad/gamepad.c index 154b71a6e..82e1b29af 100644 --- a/src/modules/gamepad/gamepad.c +++ b/src/modules/gamepad/gamepad.c @@ -9,13 +9,13 @@ static void printDevice(FFGamepadOptions* options, const FFGamepadDevice* device, uint8_t index) { + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_GAMEPAD_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); bool showBatteryLevel = device->battery > 0 && device->battery <= 100; - FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if (showBatteryLevel && (percentType & FF_PERCENTAGE_TYPE_BAR_BIT)) { @@ -37,9 +37,11 @@ static void printDevice(FFGamepadOptions* options, const FFGamepadDevice* device else { FF_STRBUF_AUTO_DESTROY percentageNum = ffStrbufCreate(); - ffPercentAppendNum(&percentageNum, device->battery, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&percentageNum, device->battery, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY percentageBar = ffStrbufCreate(); - ffPercentAppendBar(&percentageBar, device->battery, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&percentageBar, device->battery, options->percent, &options->moduleArgs); FF_PRINT_FORMAT_CHECKED(FF_GAMEPAD_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_GAMEPAD_NUM_FORMAT_ARGS, ((FFformatarg[]) { FF_FORMAT_ARG(device->name, "name"), diff --git a/src/modules/memory/memory.c b/src/modules/memory/memory.c index d364225c1..8cad52839 100644 --- a/src/modules/memory/memory.c +++ b/src/modules/memory/memory.c @@ -29,6 +29,7 @@ void ffPrintMemory(FFMemoryOptions* options) ? 0 : (double) storage.bytesUsed / (double) storage.bytesTotal * 100.0; + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_MEMORY_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); @@ -37,7 +38,6 @@ void ffPrintMemory(FFMemoryOptions* options) else { FF_STRBUF_AUTO_DESTROY str = ffStrbufCreate(); - FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if(percentType & FF_PERCENTAGE_TYPE_BAR_BIT) { @@ -58,9 +58,12 @@ void ffPrintMemory(FFMemoryOptions* options) else { FF_STRBUF_AUTO_DESTROY percentageNum = ffStrbufCreate(); - ffPercentAppendNum(&percentageNum, percentage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&percentageNum, percentage, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY percentageBar = ffStrbufCreate(); - ffPercentAppendBar(&percentageBar, percentage, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&percentageBar, percentage, options->percent, &options->moduleArgs); + FF_PRINT_FORMAT_CHECKED(FF_MEMORY_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_MEMORY_NUM_FORMAT_ARGS, ((FFformatarg[]){ FF_FORMAT_ARG(usedPretty, "used"), FF_FORMAT_ARG(totalPretty, "total"), diff --git a/src/modules/sound/sound.c b/src/modules/sound/sound.c index dafc37619..1e0cd7e84 100644 --- a/src/modules/sound/sound.c +++ b/src/modules/sound/sound.c @@ -9,10 +9,10 @@ static void printDevice(FFSoundOptions* options, const FFSoundDevice* device, uint8_t index) { + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_SOUND_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); - FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; FF_STRBUF_AUTO_DESTROY str = ffStrbufCreate(); if (!(percentType & FF_PERCENTAGE_TYPE_HIDE_OTHERS_BIT)) @@ -48,9 +48,11 @@ static void printDevice(FFSoundOptions* options, const FFSoundDevice* device, ui else { FF_STRBUF_AUTO_DESTROY percentageNum = ffStrbufCreate(); - ffPercentAppendNum(&percentageNum, device->volume, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&percentageNum, device->volume, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY percentageBar = ffStrbufCreate(); - ffPercentAppendBar(&percentageBar, device->volume, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&percentageBar, device->volume, options->percent, &options->moduleArgs); FF_PRINT_FORMAT_CHECKED(FF_SOUND_MODULE_NAME, index, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_SOUND_NUM_FORMAT_ARGS, ((FFformatarg[]) { FF_FORMAT_ARG(device->main, "is-main"), diff --git a/src/modules/swap/swap.c b/src/modules/swap/swap.c index c71831571..6fba1f3aa 100644 --- a/src/modules/swap/swap.c +++ b/src/modules/swap/swap.c @@ -29,11 +29,11 @@ void ffPrintSwap(FFSwapOptions* options) ? 0 : (double) storage.bytesUsed / (double) storage.bytesTotal * 100.0; + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if(options->moduleArgs.outputFormat.length == 0) { ffPrintLogoAndKey(FF_SWAP_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT); FF_STRBUF_AUTO_DESTROY str = ffStrbufCreate(); - FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if (storage.bytesTotal == 0) { @@ -68,9 +68,11 @@ void ffPrintSwap(FFSwapOptions* options) else { FF_STRBUF_AUTO_DESTROY percentageNum = ffStrbufCreate(); - ffPercentAppendNum(&percentageNum, percentage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&percentageNum, percentage, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY percentageBar = ffStrbufCreate(); - ffPercentAppendBar(&percentageBar, percentage, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&percentageBar, percentage, options->percent, &options->moduleArgs); FF_PRINT_FORMAT_CHECKED(FF_SWAP_MODULE_NAME, 0, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_SWAP_NUM_FORMAT_ARGS, ((FFformatarg[]){ FF_FORMAT_ARG(usedPretty, "used"), FF_FORMAT_ARG(totalPretty, "total"), diff --git a/src/modules/wifi/wifi.c b/src/modules/wifi/wifi.c index be6b63649..b2d829d42 100644 --- a/src/modules/wifi/wifi.c +++ b/src/modules/wifi/wifi.c @@ -79,9 +79,12 @@ void ffPrintWifi(FFWifiOptions* options) else { FF_STRBUF_AUTO_DESTROY percentNum = ffStrbufCreate(); - ffPercentAppendNum(&percentNum, item->conn.signalQuality, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&percentNum, item->conn.signalQuality, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY percentBar = ffStrbufCreate(); - ffPercentAppendBar(&percentBar, item->conn.signalQuality, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&percentBar, item->conn.signalQuality, options->percent, &options->moduleArgs); + FF_PRINT_FORMAT_CHECKED(FF_WIFI_MODULE_NAME, moduleIndex, &options->moduleArgs, FF_PRINT_TYPE_DEFAULT, FF_WIFI_NUM_FORMAT_ARGS, ((FFformatarg[]){ FF_FORMAT_ARG(item->inf.description, "inf-desc"), FF_FORMAT_ARG(item->inf.status, "inf-status"), diff --git a/src/modules/zpool/zpool.c b/src/modules/zpool/zpool.c index a8e56146f..a47cb244d 100644 --- a/src/modules/zpool/zpool.c +++ b/src/modules/zpool/zpool.c @@ -34,6 +34,7 @@ static void printZpool(FFZpoolOptions* options, FFZpoolResult* result, uint8_t i ffParseSize(result->total, &totalPretty); double bytesPercentage = result->total > 0 ? (double) result->used / (double) result->total * 100.0 : 0; + FFPercentageTypeFlags percentType = options->percent.type == 0 ? instance.config.display.percentType : options->percent.type; if(options->moduleArgs.outputFormat.length == 0) { @@ -50,14 +51,18 @@ static void printZpool(FFZpoolOptions* options, FFZpoolResult* result, uint8_t i else { FF_STRBUF_AUTO_DESTROY bytesPercentageNum = ffStrbufCreate(); - ffPercentAppendNum(&bytesPercentageNum, bytesPercentage, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&bytesPercentageNum, bytesPercentage, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY bytesPercentageBar = ffStrbufCreate(); - ffPercentAppendBar(&bytesPercentageBar, bytesPercentage, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&bytesPercentageBar, bytesPercentage, options->percent, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY fragPercentageNum = ffStrbufCreate(); - ffPercentAppendNum(&fragPercentageNum, result->fragmentation, options->percent, false, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_NUM_BIT) + ffPercentAppendNum(&fragPercentageNum, result->fragmentation, options->percent, false, &options->moduleArgs); FF_STRBUF_AUTO_DESTROY fragPercentageBar = ffStrbufCreate(); - ffPercentAppendBar(&fragPercentageBar, result->fragmentation, options->percent, &options->moduleArgs); + if (percentType & FF_PERCENTAGE_TYPE_BAR_BIT) + ffPercentAppendBar(&fragPercentageBar, result->fragmentation, options->percent, &options->moduleArgs); FF_PRINT_FORMAT_CHECKED(buffer.chars, 0, &options->moduleArgs, FF_PRINT_TYPE_NO_CUSTOM_KEY, FF_ZPOOL_NUM_FORMAT_ARGS, ((FFformatarg[]) { FF_FORMAT_ARG(result->name, "name"),