Skip to content

Instantly share code, notes, and snippets.

@alexcrichton
Last active April 5, 2020 05:01
Show Gist options
  • Save alexcrichton/63306ad872ad01b390e5 to your computer and use it in GitHub Desktop.
Save alexcrichton/63306ad872ad01b390e5 to your computer and use it in GitHub Desktop.
#![feature(io)]
use std::io;
use std::io::prelude::*;
fn main() {
let mut stdin = io::stdin();
let mut stdout = io::stdout();
loop {
write!(&mut stdout, "> ");
stdout.flush();
let mut input = String::new();
stdin.read_line(&mut input);
if input == "exit\n" {
break;
}
writeln!(&mut stdout, "Input: {:?}", input);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment