about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2013-04-13 21:02:43 +1000
committerHuon Wilson <dbau.pp+github@gmail.com>2013-04-13 21:02:43 +1000
commitd70f0f1a6e9ae3e2a998c60f4e2843507260f839 (patch)
tree496413a4110ce1f2442e298ace32465f526040a8
parent65ff441b3d25d83335dc46ed4ef86421fca29c8d (diff)
downloadrust-d70f0f1a6e9ae3e2a998c60f4e2843507260f839.tar.gz
rust-d70f0f1a6e9ae3e2a998c60f4e2843507260f839.zip
librust: make `rust run file.rs` past any extra arguments to the compiled program.
-rw-r--r--src/librust/rust.rc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/librust/rust.rc b/src/librust/rust.rc
index 624a4701d98..bf35cae27dd 100644
--- a/src/librust/rust.rc
+++ b/src/librust/rust.rc
@@ -67,8 +67,8 @@ static commands: &'static [Command<'static>] = &[
         usage_line: "build an executable, and run it",
         usage_full: UsgStr(
             "The run command is an shortcut for the command line \n\
-             \"rustc <filename> -o <filestem>~ && ./<filestem>~\".\
-            \n\nUsage:\trust run <filename>"
+             \"rustc <filename> -o <filestem>~ && ./<filestem>~ [<arguments>...]\".\
+            \n\nUsage:\trust run <filename> [<arguments>...]"
         )
     },
     Command{
@@ -169,14 +169,14 @@ fn cmd_test(args: &[~str]) -> ValidUsage {
 
 fn cmd_run(args: &[~str]) -> ValidUsage {
     match args {
-        [filename] => {
+        [filename, ..prog_args] => {
             let exec = Path(filename).filestem().unwrap() + "~";
             if run::run_program("rustc", [
                 filename.to_owned(),
                 ~"-o",
                 exec.to_owned()
             ]) == 0 {
-                run::run_program(~"./"+exec, []);
+                run::run_program(~"./"+exec, prog_args);
             }
             Valid
         }