MCPcopy Create free account
hub / github.com/Autoparallel/learner / confirm

Method confirm

crates/learnerd/src/commands/mod.rs:306–315  ·  view source on GitHub ↗

Request confirmation from the user Displays a yes/no prompt with the given message and returns the user's choice. If `accept_defaults` is true, automatically returns false without prompting.

(&mut self, message: &str)

Source from the content-addressed store, hash-verified

304 /// Displays a yes/no prompt with the given message and returns the user's choice.
305 /// If `accept_defaults` is true, automatically returns false without prompting.
306 fn confirm(&mut self, message: &str) -> Result<bool> {
307 println!("\n{} {}", style(PROMPT_PREFIX).yellow(), style(message).yellow().bold());
308
309 if self.args.accept_defaults {
310 return Ok(false);
311 }
312
313 let theme = dialoguer::theme::ColorfulTheme::default();
314 Ok(Confirm::with_theme(&theme).with_prompt("").default(false).interact()?)
315 }
316
317 /// Request text input from the user
318 ///

Callers 3

removeFunction · 0.45
addFunction · 0.45
initFunction · 0.45

Calls 1

defaultMethod · 0.45

Tested by

no test coverage detected