Global: add new unit related options

1. `--<module>-space-before-unit`
2. `--duration-abbreviation`
3. various code refactoring and cleanups
This commit is contained in:
李通洲
2025-07-30 14:30:36 +08:00
parent 8be419cfd6
commit a0174e8666
33 changed files with 556 additions and 174 deletions
+4 -3
View File
@@ -2,6 +2,7 @@
#include "common/jsonconfig.h"
#include "common/parsing.h"
#include "common/temps.h"
#include "common/frequency.h"
#include "detection/cpu/cpu.h"
#include "modules/cpu/cpu.h"
#include "util/stringUtils.h"
@@ -77,7 +78,7 @@ void ffPrintCPU(FFCPUOptions* options)
if(freq > 0)
{
ffStrbufAppendS(&str, " @ ");
ffParseFrequency(freq, &str);
ffFreqAppendNum(freq, &str);
}
if(cpu.temperature == cpu.temperature) //FF_CPU_TEMP_UNSET
@@ -91,9 +92,9 @@ void ffPrintCPU(FFCPUOptions* options)
else
{
FF_STRBUF_AUTO_DESTROY freqBase = ffStrbufCreate();
ffParseFrequency(cpu.frequencyBase, &freqBase);
ffFreqAppendNum(cpu.frequencyBase, &freqBase);
FF_STRBUF_AUTO_DESTROY freqMax = ffStrbufCreate();
ffParseFrequency(cpu.frequencyMax, &freqMax);
ffFreqAppendNum(cpu.frequencyMax, &freqMax);
FF_STRBUF_AUTO_DESTROY tempStr = ffStrbufCreate();
ffTempsAppendNum(cpu.temperature, &tempStr, options->tempConfig, &options->moduleArgs);