@@ -130,6 +130,8 @@ const char* ffOptionsParseDisplayJsonConfig(FFOptionsDisplay* options, yyjson_va
130130 {
131131 int value ;
132132 const char * error = ffJsonConfigParseEnum (unit , & value , (FFKeyValuePair []) {
133+ { "DEFAULT" , FF_TEMPERATURE_UNIT_DEFAULT },
134+ { "D" , FF_TEMPERATURE_UNIT_DEFAULT },
133135 { "CELSIUS" , FF_TEMPERATURE_UNIT_CELSIUS },
134136 { "C" , FF_TEMPERATURE_UNIT_CELSIUS },
135137 { "FAHRENHEIT" , FF_TEMPERATURE_UNIT_FAHRENHEIT },
@@ -418,6 +420,8 @@ bool ffOptionsParseDisplayCommandLine(FFOptionsDisplay* options, const char* key
418420 if (ffStrEqualsIgnCase (subkey , "unit" ))
419421 {
420422 options -> tempUnit = (FFTemperatureUnit ) ffOptionParseEnum (key , value , (FFKeyValuePair []) {
423+ { "DEFAULT" , FF_TEMPERATURE_UNIT_DEFAULT },
424+ { "D" , FF_TEMPERATURE_UNIT_DEFAULT },
421425 { "CELSIUS" , FF_TEMPERATURE_UNIT_CELSIUS },
422426 { "C" , FF_TEMPERATURE_UNIT_CELSIUS },
423427 { "FAHRENHEIT" , FF_TEMPERATURE_UNIT_FAHRENHEIT },
@@ -513,7 +517,7 @@ void ffOptionsInitDisplay(FFOptionsDisplay* options)
513517 options -> keyPaddingLeft = 0 ;
514518 options -> keyType = FF_MODULE_KEY_TYPE_STRING ;
515519
516- options -> tempUnit = FF_TEMPERATURE_UNIT_CELSIUS ;
520+ options -> tempUnit = FF_TEMPERATURE_UNIT_DEFAULT ;
517521 options -> tempNdigits = 1 ;
518522 ffStrbufInitStatic (& options -> tempColorGreen , FF_COLOR_FG_GREEN );
519523 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
643647 {
644648 switch (options -> tempUnit )
645649 {
650+ case FF_TEMPERATURE_UNIT_DEFAULT :
651+ yyjson_mut_obj_add_str (doc , temperature , "unit" , "DEFAULT" );
652+ break ;
646653 case FF_TEMPERATURE_UNIT_CELSIUS :
647654 yyjson_mut_obj_add_str (doc , obj , "unit" , "C" );
648655 break ;
0 commit comments