@@ -40,13 +40,13 @@ bool ffPrintSeparator(FFSeparatorOptions* options)
40
40
if (options -> outputColor .length && !instance .config .display .pipe )
41
41
ffPrintColor (& options -> outputColor );
42
42
43
- if (options -> length > 0 )
43
+ if (options -> times > 0 )
44
44
{
45
45
if (__builtin_expect (options -> string .length == 1 , 1 ))
46
- ffPrintCharTimes (options -> string .chars [0 ], options -> length );
46
+ ffPrintCharTimes (options -> string .chars [0 ], options -> times );
47
47
else
48
48
{
49
- for (uint32_t i = 0 ; i < options -> length ; i ++ )
49
+ for (uint32_t i = 0 ; i < options -> times ; i ++ )
50
50
{
51
51
fputs (options -> string .chars , stdout );
52
52
}
@@ -136,9 +136,15 @@ void ffParseSeparatorJsonObject(FFSeparatorOptions* options, yyjson_val* module)
136
136
continue ;
137
137
}
138
138
139
+ if (unsafe_yyjson_equals_str (key , "times" ))
140
+ {
141
+ options -> times = (uint32_t ) yyjson_get_uint (val );
142
+ continue ;
143
+ }
144
+
139
145
if (unsafe_yyjson_equals_str (key , "length" ))
140
146
{
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." );
142
148
continue ;
143
149
}
144
150
@@ -150,14 +156,14 @@ void ffGenerateSeparatorJsonConfig(FFSeparatorOptions* options, yyjson_mut_doc*
150
156
{
151
157
yyjson_mut_obj_add_strbuf (doc , module , "string" , & options -> string );
152
158
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 );
154
160
}
155
161
156
162
void ffInitSeparatorOptions (FFSeparatorOptions * options )
157
163
{
158
164
ffStrbufInitStatic (& options -> string , "-" );
159
165
ffStrbufInit (& options -> outputColor );
160
- options -> length = 0 ;
166
+ options -> times = 0 ;
161
167
}
162
168
163
169
void ffDestroySeparatorOptions (FFSeparatorOptions * options )
0 commit comments