mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-12 10:22:12 +02:00
Display: rename --temperature-* to --temp-* as stated in help messages
Fix #908
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ void ffTempsAppendNum(double celsius, FFstrbuf* buffer, FFColorRangeConfig confi
|
||||
}
|
||||
}
|
||||
|
||||
switch (options->temperatureUnit)
|
||||
switch (options->tempUnit)
|
||||
{
|
||||
case FF_TEMPERATURE_UNIT_CELSIUS:
|
||||
ffStrbufAppendF(buffer, "%.*f°C", options->tempNdigits, celsius);
|
||||
|
||||
@@ -116,7 +116,7 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
|
||||
{},
|
||||
});
|
||||
if (error) return error;
|
||||
options->temperatureUnit = (FFTemperatureUnit) value;
|
||||
options->tempUnit = (FFTemperatureUnit) value;
|
||||
}
|
||||
|
||||
yyjson_val* ndigits = yyjson_obj_get(val, "ndigits");
|
||||
@@ -285,12 +285,12 @@ bool ffOptionsParseDisplayCommandLine(FFOptionsDisplay* options, const char* key
|
||||
{}
|
||||
});
|
||||
}
|
||||
else if(ffStrStartsWithIgnCase(key, "--temperature-"))
|
||||
else if(ffStrStartsWithIgnCase(key, "--temp-"))
|
||||
{
|
||||
const char* subkey = key + strlen("--temperature-");
|
||||
const char* subkey = key + strlen("--temp-");
|
||||
if(ffStrEqualsIgnCase(subkey, "unit"))
|
||||
{
|
||||
options->temperatureUnit = (FFTemperatureUnit) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
|
||||
options->tempUnit = (FFTemperatureUnit) ffOptionParseEnum(key, value, (FFKeyValuePair[]) {
|
||||
{ "CELSIUS", FF_TEMPERATURE_UNIT_CELSIUS },
|
||||
{ "C", FF_TEMPERATURE_UNIT_CELSIUS },
|
||||
{ "FAHRENHEIT", FF_TEMPERATURE_UNIT_FAHRENHEIT },
|
||||
@@ -375,7 +375,7 @@ void ffOptionsInitDisplay(FFOptionsDisplay* options)
|
||||
options->noBuffer = false;
|
||||
options->keyWidth = 0;
|
||||
|
||||
options->temperatureUnit = FF_TEMPERATURE_UNIT_CELSIUS;
|
||||
options->tempUnit = FF_TEMPERATURE_UNIT_CELSIUS;
|
||||
options->tempNdigits = 1;
|
||||
ffStrbufInitStatic(&options->tempColorGreen, FF_COLOR_FG_GREEN);
|
||||
ffStrbufInitStatic(&options->tempColorYellow, FF_COLOR_FG_LIGHT_YELLOW);
|
||||
@@ -488,9 +488,9 @@ void ffOptionsGenerateDisplayJsonConfig(FFOptionsDisplay* options, yyjson_mut_do
|
||||
|
||||
{
|
||||
yyjson_mut_val* temperature = yyjson_mut_obj(doc);
|
||||
if (options->temperatureUnit != defaultOptions.temperatureUnit)
|
||||
if (options->tempUnit != defaultOptions.tempUnit)
|
||||
{
|
||||
switch (options->temperatureUnit)
|
||||
switch (options->tempUnit)
|
||||
{
|
||||
case FF_TEMPERATURE_UNIT_CELSIUS:
|
||||
yyjson_mut_obj_add_str(doc, obj, "unit", "C");
|
||||
|
||||
@@ -35,7 +35,7 @@ typedef struct FFOptionsDisplay
|
||||
FFBinaryPrefixType binaryPrefixType;
|
||||
uint8_t sizeNdigits;
|
||||
uint8_t sizeMaxPrefix;
|
||||
FFTemperatureUnit temperatureUnit;
|
||||
FFTemperatureUnit tempUnit;
|
||||
uint8_t tempNdigits;
|
||||
FFstrbuf tempColorGreen;
|
||||
FFstrbuf tempColorYellow;
|
||||
|
||||
Reference in New Issue
Block a user