bunpen: execute the given argv
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
// vim: set shiftwidth=2 :
|
||||
use fmt;
|
||||
use strings;
|
||||
use os;
|
||||
use os::exec;
|
||||
|
||||
fn do_exec(args: []str) never = {
|
||||
let joined = strings::join(" ", args...);
|
||||
fmt::printfln("exec: {}", joined)!;
|
||||
free(joined);
|
||||
|
||||
let cmd = os::exec::cmd(args[0], args[1..]...)!;
|
||||
os::exec::exec(&cmd);
|
||||
};
|
||||
|
||||
export fn main() void = {
|
||||
fmt::println("Hello world!")!;
|
||||
let my_name = os::args[0];
|
||||
let exec_line = os::args[1..];
|
||||
do_exec(exec_line);
|
||||
};
|
||||
|
Reference in New Issue
Block a user