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

Method print

crates/chat-cli/src/cli/mod.rs:79–91  ·  view source on GitHub ↗
(&self, text_fn: TFn, json_fn: JFn)

Source from the content-addressed store, hash-verified

77
78impl OutputFormat {
79 pub fn print<T, TFn, J, JFn>(&self, text_fn: TFn, json_fn: JFn)
80 where
81 T: std::fmt::Display,
82 TFn: FnOnce() -> T,
83 J: Serialize,
84 JFn: FnOnce() -> J,
85 {
86 match self {
87 OutputFormat::Plain => println!("{}", text_fn()),
88 OutputFormat::Json => println!("{}", serde_json::to_string(&json_fn()).unwrap()),
89 OutputFormat::JsonPretty => println!("{}", serde_json::to_string_pretty(&json_fn()).unwrap()),
90 }
91 }
92}
93
94/// The Amazon Q CLI

Callers 3

mainFunction · 0.80
executeMethod · 0.80
executeMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected