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]

[src]

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

[src]

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

[src]

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

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

[src]

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