File tree 1 file changed +20
-1
lines changed
1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,20 @@ impl Cli {
174
174
. possible_values ( color_values)
175
175
. help ( "Colors (X X X...) to print the ascii art." ) ,
176
176
)
177
+ . arg (
178
+ Arg :: with_name ( "true-color" )
179
+ . long ( "true-color" )
180
+ . value_name ( "WHEN" )
181
+ . takes_value ( true )
182
+ . possible_values ( & [ "auto" , "never" , "always" ] )
183
+ . default_value ( "auto" )
184
+ . hide_default_value ( true )
185
+ . help ( "Specify when to use true color (*auto*, never, always)." )
186
+ . long_help (
187
+ "Specify when to use true color (*auto*, never, always). \n \
188
+ If set to auto: true color will be enabled if supported by the terminal."
189
+ )
190
+ )
177
191
. arg (
178
192
Arg :: with_name ( "text-colors" )
179
193
. short ( "t" )
@@ -249,7 +263,12 @@ impl Cli {
249
263
)
250
264
. get_matches ( ) ;
251
265
252
- let true_color = cli_utils:: is_truecolor_terminal ( ) ;
266
+ let true_color = match matches. value_of ( "true-color" ) {
267
+ Some ( "always" ) => true ,
268
+ Some ( "never" ) => false ,
269
+ Some ( "auto" ) => cli_utils:: is_truecolor_terminal ( ) ,
270
+ _ => unreachable ! ( ) ,
271
+ } ;
253
272
let no_bold = matches. is_present ( "no-bold" ) ;
254
273
let no_merges = matches. is_present ( "no-merge-commits" ) ;
255
274
let no_color_palette = matches. is_present ( "no-color-palette" ) ;
You can’t perform that action at this time.
0 commit comments