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

Function input

crates/chat-cli/src/util/mod.rs:85–99  ·  view source on GitHub ↗
(prompt: &str, initial_text: Option<&str>)

Source from the content-addressed store, hash-verified

83}
84
85pub fn input(prompt: &str, initial_text: Option<&str>) -> Result<String> {
86 if !stdout().is_terminal() {
87 warn!("called input while stdout is not a terminal");
88 return Ok(String::new());
89 }
90
91 let theme = dialoguer_theme();
92 let mut input = dialoguer::Input::with_theme(&theme).with_prompt(prompt);
93
94 if let Some(initial_text) = initial_text {
95 input = input.with_initial_text(initial_text);
96 }
97
98 Ok(input.interact_text()?)
99}
100
101pub fn dialoguer_theme() -> ColorfulTheme {
102 ColorfulTheme {

Callers 4

executeMethod · 0.85
execute_createMethod · 0.85
execute_removeMethod · 0.85
executeMethod · 0.85

Calls 1

dialoguer_themeFunction · 0.85

Tested by

no test coverage detected