diff options
| author | mo8it <mo8it@proton.me> | 2024-04-21 23:24:10 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-04-21 23:24:10 +0200 |
| commit | e3b9124b85502d21b8d45abe8e4e7e4d3e08e7be (patch) | |
| tree | 5c6295cdbbe8f6ff0a6756c11825318cc6adf128 /src/main.rs | |
| parent | 642c3bd37e3195f7f744a5fa60a53e59d8da5526 (diff) | |
Add a confirmation prompt to the init subcommand
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 494c40d..f52699c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,6 +88,14 @@ fn main() -> Result<()> { 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"); } Some(Subcommands::Dev(dev_command)) => return dev_command.run(), |
