From 71039e68febcef6352dfd9b872b7f93a6d83911d Mon Sep 17 00:00:00 2001 From: bppleman Date: Wed, 20 Dec 2023 22:25:56 +0800 Subject: [PATCH] Update eko --- eko/src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/eko/src/main.rs b/eko/src/main.rs index 223d6c1..807f932 100644 --- a/eko/src/main.rs +++ b/eko/src/main.rs @@ -10,6 +10,7 @@ fn main() { } let cmd = &args[1]; match cmd { + cmd if cmd == "echo" => echo(), cmd if cmd == "stdout" => stdout(), cmd if cmd == "stderr" => stderr(), cmd if cmd == "interval" => interval( @@ -23,6 +24,13 @@ fn main() { }; } +fn echo() { + let mut line = String::new(); + if stdin().read_line(&mut line).is_ok() { + print!("{}", line); + } +} + fn stdout() { for line in stdin().lines() { match line {