(&self)
| 47 | |
| 48 | impl Command for Diagnostics { |
| 49 | fn run(&self) -> CliResult<()> { |
| 50 | let report = collect::collect(); |
| 51 | if self.json { |
| 52 | println!( |
| 53 | "{}", |
| 54 | serde_json::to_string_pretty(&report) |
| 55 | .expect("the report is plain data and always serializes") |
| 56 | ); |
| 57 | } else { |
| 58 | print!("{}", render::render_text(&report)); |
| 59 | } |
| 60 | Ok(()) |
| 61 | } |
| 62 | } |