diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index ff6d90e..d1a25a6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use std::collections::HashSet; use std::io; use std::io::prelude::*; use std::os::unix::fs::PermissionsExt; +use std::process::Command; #[macro_use] extern crate lalrpop_util; @@ -49,7 +50,7 @@ fn repl() -> Result<()> { fn prompt() -> Result<()> { - print!("$ "); + print!("\n$ "); io::stdout().flush()?; Ok(()) @@ -89,7 +90,12 @@ fn execute(input: &str) -> Result<()> { [command_name, ..] => { match find_executable_path(command_name)? { Some(executable_path) => { - println!("{}", executable_path); + let mut command = Command::new(executable_path.to_sys_path()); + + let arguments = &invocation[1..]; + command.args(arguments); + + let _status = command.status()?; } None => { println!("Command not found: {}", command_name); |