mirror of
https://github.com/rust-lang/rustlings
synced 2024-11-10 13:10:40 +00:00
Add a confirmation prompt to the init subcommand
This commit is contained in:
parent
642c3bd37e
commit
e3b9124b85
@ -88,6 +88,14 @@ fn main() -> Result<()> {
|
|||||||
bail!("Disabled in the debug build");
|
bail!("Disabled in the debug build");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
let mut stdout = io::stdout().lock();
|
||||||
|
stdout.write_all(b"This command will create the directory `rustlings/` which will contain the exercises.\nPress ENTER to continue ")?;
|
||||||
|
stdout.flush()?;
|
||||||
|
io::stdin().lock().read_until(b'\n', &mut Vec::new())?;
|
||||||
|
stdout.write_all(b"\n")?;
|
||||||
|
}
|
||||||
|
|
||||||
return init::init().context("Initialization failed");
|
return init::init().context("Initialization failed");
|
||||||
}
|
}
|
||||||
Some(Subcommands::Dev(dev_command)) => return dev_command.run(),
|
Some(Subcommands::Dev(dev_command)) => return dev_command.run(),
|
||||||
|
Loading…
Reference in New Issue
Block a user