@@ -224,23 +224,25 @@ fn show_option_versions(command: &str) -> Arg {
224
224
r#"{short_help}
225
225
226
226
<bold><underline>Values:</underline></bold>
227
- <blue>ignored</> Show instances and dependencies which syncpack is ignoring
228
227
<blue>instances</> Show every instance of every dependency
229
228
<blue>hints</> Show a hint alongside dependencies developed in this repo
230
229
<blue>statuses</> Show specifically how/why a dependency or instance is valid or invalid
231
230
<blue>all</> Shorthand to enable all of the above
231
+ <blue>none</> Shorthand to disable all of the above
232
232
233
233
<bold><underline>Examples:</underline></bold>
234
234
<dim>Only opt into showing status codes</dim>
235
235
<dim>$</dim> <blue><bold>syncpack {command}</bold> --show statuses</>
236
- <dim>Show all instances, including ignored </dim>
237
- <dim>$</dim> <blue><bold>syncpack {command}</bold> --show ignored, instances</>
236
+ <dim>Show all instances, not just their names </dim>
237
+ <dim>$</dim> <blue><bold>syncpack {command}</bold> --show instances</>
238
238
<dim>Show highest level of detail</dim>
239
- <dim>$</dim> <blue><bold>syncpack {command}</bold> --show all</>"#
239
+ <dim>$</dim> <blue><bold>syncpack {command}</bold> --show all</>
240
+ <dim>Show lowest level of detail</dim>
241
+ <dim>$</dim> <blue><bold>syncpack {command}</bold> --show none</>"#
240
242
) )
241
243
. value_delimiter ( ',' )
242
- . value_parser ( [ "hints" , "ignored " , "instances " , "statuses " , "all " ] )
243
- . default_value ( "hints,instances,statuses " )
244
+ . value_parser ( [ "hints" , "instances " , "statuses " , "all " , "none " ] )
245
+ . default_value ( "all " )
244
246
}
245
247
246
248
fn sort_option ( command : & str ) -> Arg {
@@ -490,10 +492,14 @@ fn should_show(matches: &ArgMatches, name: &str) -> bool {
490
492
. ok ( )
491
493
. flatten ( )
492
494
. map ( |show| {
493
- show
494
- . collect_vec ( )
495
- . iter ( )
496
- . any ( |value| value == & & "all" . to_string ( ) || value == & & name. to_string ( ) )
495
+ let names = show. collect_vec ( ) ;
496
+ if names. contains ( & & "all" . to_string ( ) ) {
497
+ true
498
+ } else if names. contains ( & & "none" . to_string ( ) ) {
499
+ false
500
+ } else {
501
+ names. contains ( & & name. to_string ( ) )
502
+ }
497
503
} )
498
504
. unwrap_or ( false )
499
505
}
0 commit comments