(sheet: &str, config: &GlobalConfig)
| 317 | } |
| 318 | |
| 319 | fn hint_no_input(sheet: &str, config: &GlobalConfig) { |
| 320 | let colors = config.colors(); |
| 321 | let error_label = maybe_color(colors, "error", |s| bold_red(s)); |
| 322 | let help_label = maybe_color(colors, "help", |s| bold_green(s)); |
| 323 | eprintln!("{}: no CSS files to check", error_label); |
| 324 | eprintln!(); |
| 325 | eprintln!("{}: usage: csskit check <rules.cks> <file1.css> [more.css...]", help_label); |
| 326 | |
| 327 | if sheet.ends_with(".css") { |
| 328 | let cks = find_cks_hint(); |
| 329 | let cmd = format!("csskit check {cks} {sheet}"); |
| 330 | let help_label = maybe_color(colors, "help", |s| bold_green(s)); |
| 331 | eprintln!( |
| 332 | "{}: `{}` looks like a CSS file, did you mean `{}`?", |
| 333 | help_label, |
| 334 | sheet, |
| 335 | maybe_color(colors, &cmd, |s| bold_green(s)) |
| 336 | ); |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | fn hint_bad_sheet(sheet: &str, input: &[String], config: &GlobalConfig) { |
| 341 | if !sheet.ends_with(".css") { |
no test coverage detected