Struct exec::Command [] [src]

pub struct Command { /* fields omitted */ }

Build a command to execute. This has an API which is deliberately similar to std::process::Command.

let err = exec::Command::new("echo")
    .arg("hello")
    .arg("world")
    .exec();
println!("Error: {}", err);

If the exec function succeeds, it will never return.

Methods

impl Command
[src]

Create a new command builder, specifying the program to run. The program will be searched for using the usual rules for PATH.

Add an argument to the command builder. This can be chained.

Add multiple arguments to the command builder. This can be chained.

let err = exec::Command::new("echo")
    .args(&["hello", "world"])
    .exec();
println!("Error: {}", err);

Execute the command we built. If this function succeeds, it will never return.