MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / execute

Method execute

crates/chat-cli/src/cli/diagnostics.rs:38–68  ·  view source on GitHub ↗
(&self, os: &Os)

Source from the content-addressed store, hash-verified

36
37impl DiagnosticArgs {
38 pub async fn execute(&self, os: &Os) -> Result<ExitCode> {
39 let spinner = if stdout().is_terminal() {
40 Some(Spinner::new(Spinners::Dots, "Generating...".into()))
41 } else {
42 None
43 };
44
45 if spinner.is_some() {
46 execute!(std::io::stdout(), cursor::Hide)?;
47
48 ctrlc::set_handler(move || {
49 execute!(std::io::stdout(), cursor::Show).ok();
50 std::process::exit(1);
51 })?;
52 }
53
54 let diagnostics = Diagnostics::new(&os.env).await;
55
56 if let Some(mut sp) = spinner {
57 sp.stop();
58 execute!(std::io::stdout(), Clear(ClearType::CurrentLine), cursor::Show)?;
59 println!();
60 }
61
62 self.format.print(
63 || diagnostics.user_readable().expect("Failed to run user_readable()"),
64 || &diagnostics,
65 );
66
67 Ok(ExitCode::SUCCESS)
68 }
69}

Callers

nothing calls this directly

Calls 3

printMethod · 0.80
user_readableMethod · 0.80
stopMethod · 0.45

Tested by

no test coverage detected