@@ -40,13 +40,13 @@ bool ffPrintSeparator(FFSeparatorOptions* options)
4040 if (options -> outputColor .length && !instance .config .display .pipe )
4141 ffPrintColor (& options -> outputColor );
4242
43- if (options -> length > 0 )
43+ if (options -> times > 0 )
4444 {
4545 if (__builtin_expect (options -> string .length == 1 , 1 ))
46- ffPrintCharTimes (options -> string .chars [0 ], options -> length );
46+ ffPrintCharTimes (options -> string .chars [0 ], options -> times );
4747 else
4848 {
49- for (uint32_t i = 0 ; i < options -> length ; i ++ )
49+ for (uint32_t i = 0 ; i < options -> times ; i ++ )
5050 {
5151 fputs (options -> string .chars , stdout );
5252 }
@@ -136,9 +136,15 @@ void ffParseSeparatorJsonObject(FFSeparatorOptions* options, yyjson_val* module)
136136 continue ;
137137 }
138138
139+ if (unsafe_yyjson_equals_str (key , "times" ))
140+ {
141+ options -> times = (uint32_t ) yyjson_get_uint (val );
142+ continue ;
143+ }
144+
139145 if (unsafe_yyjson_equals_str (key , "length" ))
140146 {
141- options -> length = ( uint32_t ) yyjson_get_uint ( val );
147+ ffPrintError ( FF_SEPARATOR_MODULE_NAME , 0 , NULL , FF_PRINT_TYPE_NO_CUSTOM_KEY , "The option length has been renamed to times." );
142148 continue ;
143149 }
144150
@@ -150,14 +156,14 @@ void ffGenerateSeparatorJsonConfig(FFSeparatorOptions* options, yyjson_mut_doc*
150156{
151157 yyjson_mut_obj_add_strbuf (doc , module , "string" , & options -> string );
152158 yyjson_mut_obj_add_strbuf (doc , module , "outputColor" , & options -> outputColor );
153- yyjson_mut_obj_add_uint (doc , module , "length " , options -> length );
159+ yyjson_mut_obj_add_uint (doc , module , "times " , options -> times );
154160}
155161
156162void ffInitSeparatorOptions (FFSeparatorOptions * options )
157163{
158164 ffStrbufInitStatic (& options -> string , "-" );
159165 ffStrbufInit (& options -> outputColor );
160- options -> length = 0 ;
166+ options -> times = 0 ;
161167}
162168
163169void ffDestroySeparatorOptions (FFSeparatorOptions * options )
0 commit comments