@@ -130,6 +130,8 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
130
130
{
131
131
int value ;
132
132
const char * error = ffJsonConfigParseEnum (unit , & value , (FFKeyValuePair []) {
133
+ { "DEFAULT" , FF_TEMPERATURE_UNIT_DEFAULT },
134
+ { "D" , FF_TEMPERATURE_UNIT_DEFAULT },
133
135
{ "CELSIUS" , FF_TEMPERATURE_UNIT_CELSIUS },
134
136
{ "C" , FF_TEMPERATURE_UNIT_CELSIUS },
135
137
{ "FAHRENHEIT" , FF_TEMPERATURE_UNIT_FAHRENHEIT },
@@ -418,6 +420,8 @@ bool ffOptionsParseDisplayCommandLine(FFOptionsDisplay* options, const char* key
418
420
if (ffStrEqualsIgnCase (subkey , "unit" ))
419
421
{
420
422
options -> tempUnit = (FFTemperatureUnit ) ffOptionParseEnum (key , value , (FFKeyValuePair []) {
423
+ { "DEFAULT" , FF_TEMPERATURE_UNIT_DEFAULT },
424
+ { "D" , FF_TEMPERATURE_UNIT_DEFAULT },
421
425
{ "CELSIUS" , FF_TEMPERATURE_UNIT_CELSIUS },
422
426
{ "C" , FF_TEMPERATURE_UNIT_CELSIUS },
423
427
{ "FAHRENHEIT" , FF_TEMPERATURE_UNIT_FAHRENHEIT },
@@ -513,7 +517,7 @@ void ffOptionsInitDisplay(FFOptionsDisplay* options)
513
517
options -> keyPaddingLeft = 0 ;
514
518
options -> keyType = FF_MODULE_KEY_TYPE_STRING ;
515
519
516
- options -> tempUnit = FF_TEMPERATURE_UNIT_CELSIUS ;
520
+ options -> tempUnit = FF_TEMPERATURE_UNIT_DEFAULT ;
517
521
options -> tempNdigits = 1 ;
518
522
ffStrbufInitStatic (& options -> tempColorGreen , FF_COLOR_FG_GREEN );
519
523
ffStrbufInitStatic (& options -> tempColorYellow , instance .state .terminalLightTheme ? FF_COLOR_FG_YELLOW : FF_COLOR_FG_LIGHT_YELLOW );
@@ -643,6 +647,9 @@ void ffOptionsGenerateDisplayJsonConfig(FFOptionsDisplay* options, yyjson_mut_do
643
647
{
644
648
switch (options -> tempUnit )
645
649
{
650
+ case FF_TEMPERATURE_UNIT_DEFAULT :
651
+ yyjson_mut_obj_add_str (doc , temperature , "unit" , "DEFAULT" );
652
+ break ;
646
653
case FF_TEMPERATURE_UNIT_CELSIUS :
647
654
yyjson_mut_obj_add_str (doc , obj , "unit" , "C" );
648
655
break ;
0 commit comments