@@ -218,15 +218,31 @@ impl Cli {
218
218
. takes_value ( true )
219
219
. help ( "Ignore all files & directories matching EXCLUDE." ) ,
220
220
)
221
+ . arg (
222
+ Arg :: with_name ( "show-logo" )
223
+ . short ( "S" )
224
+ . long ( "show-logo" )
225
+ . takes_value ( false )
226
+ . help ( "If ASCII logo should be shown in all circumstances." )
227
+ . conflicts_with ( "hide-logo" )
228
+ )
221
229
. arg (
222
230
Arg :: with_name ( "hide-logo" )
223
231
. short ( "H" )
224
232
. long ( "hide-logo" )
225
- . value_name ( "WIDTH_THRESHOLD" )
233
+ . takes_value ( false )
234
+ . help ( "If ASCII logo should be hidden in all circumstances." )
235
+ . conflicts_with ( "show-logo" )
236
+ )
237
+ . arg (
238
+ Arg :: with_name ( "max-width" )
239
+ . short ( "w" )
240
+ . long ( "max-width" )
241
+ . value_name ( "AMOUNT" )
226
242
. takes_value ( true )
227
243
. max_values ( 1 )
228
244
. default_value ( "95" )
229
- . help ( "If ASCII logo should be hidden when terminal width is below WIDTH_THRESHOLD ." )
245
+ . help ( "If ASCII logo should be hidden when terminal width is below AMOUNT ." )
230
246
. validator (
231
247
|t| {
232
248
t. parse :: < u32 > ( )
@@ -242,9 +258,9 @@ impl Cli {
242
258
let no_color_palette = matches. is_present ( "no-color-palette" ) ;
243
259
let print_languages = matches. is_present ( "languages" ) ;
244
260
let print_package_managers = matches. is_present ( "package-managers" ) ;
245
- let mut art_off = false ;
261
+ let mut art_off = matches . is_present ( "hide-logo" ) || !matches . is_present ( "show-logo" ) ;
246
262
let true_color = cli_utils:: is_truecolor_terminal ( ) ;
247
- let max_term_size: usize = matches. value_of ( "hide-logo " ) . unwrap ( ) . parse ( ) . unwrap ( ) ;
263
+ let max_term_size: usize = matches. value_of ( "max-width " ) . unwrap ( ) . parse ( ) . unwrap ( ) ;
248
264
249
265
let fields_to_hide: Vec < String > = if let Some ( values) = matches. values_of ( "disable-fields" )
250
266
{
@@ -269,10 +285,15 @@ impl Cli {
269
285
None
270
286
} ;
271
287
272
- if let Some ( ( width, _) ) = term_size:: dimensions_stdout ( ) {
273
- art_off = width <= max_term_size && matches. is_present ( "hide-logo" ) ;
274
- } else {
275
- std:: eprintln!( "{}" , ( "Could not get terminal width. ASCII art will be displayed." ) ) ;
288
+ if !matches. is_present ( "hide-logo" ) && !matches. is_present ( "show-logo" ) {
289
+ if let Some ( ( width, _) ) = term_size:: dimensions_stdout ( ) {
290
+ art_off = width <= max_term_size;
291
+ } else {
292
+ std:: eprintln!(
293
+ "{}" ,
294
+ ( "Could not get terminal width. ASCII art will be displayed." )
295
+ ) ;
296
+ }
276
297
}
277
298
278
299
if image. is_some ( ) && image_backend. is_none ( ) {
0 commit comments