diff options
Diffstat (limited to 'test-project/src/main.rs')
| -rw-r--r-- | test-project/src/main.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test-project/src/main.rs b/test-project/src/main.rs new file mode 100644 index 0000000..4d22e98 --- /dev/null +++ b/test-project/src/main.rs @@ -0,0 +1,25 @@ +use std::{env, io}; + +fn main() { + let mut args = env::args(); + + if args.len() == 1 { + println!("***run not interactive"); + } else { + match args.nth(1).unwrap().as_str() { + "interactive" => { + let mut line = String::new(); + + io::stdin() + .read_line(&mut line) + .expect("Failed to read line"); + + println!("***run interactive: {line}"); + } + + _ => { + panic!("unexpected argument"); + } + } + } +} |
