Ajout : afficher un dollar dans stdout avant de taper une commande
This commit is contained in:
parent
675a176b77
commit
4c70fda118
1 changed files with 6 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
|||
use std::io;
|
||||
use std::io::Write;
|
||||
|
||||
mod parser;
|
||||
|
||||
|
@ -8,6 +9,11 @@ fn main() {
|
|||
|
||||
while result_bytes_read.unwrap() != 0 {
|
||||
buffer.clear();
|
||||
|
||||
print!("$ ");
|
||||
if io::stdout().flush().is_err() {
|
||||
eprintln!("error: can't fully flush stdout or reached EOF");
|
||||
}
|
||||
result_bytes_read = io::stdin().read_line(&mut buffer);
|
||||
|
||||
if !result_bytes_read.is_err() {
|
||||
|
|
Reference in a new issue