Struct commandext::CommandExt [] [src]

pub struct CommandExt { /* fields omitted */ }

Extends std::io::process::Command.

Methods

impl CommandExt
[src]

Create a new CommandExt.

Arguments

  • cmd - The command to use, i.e. "echo".
  • exec - The Executable to use when executing the command.

Note

On Windows, the cmd is built as "sh -c", and the cmd is added to the shargs string. When the command is exeuted, this results in "sh -c 'shargs'".

Set the working directory for the command.

Arguments

  • wd - The working directory for the command execution.

Set the header boolean.

Arguments

  • show_header - true, a header showing what will be executed is printed on stdout. Otherwise, no header is printed.

Add an argument to the command.

Arguments

  • arg - The argument to add to the command.

Note

On Windows, the argument is appended to the shargs value.

Add arguments to the command.

Arguments

  • args - A vector of argments to add to the command.

Note

On Windows, the arguments are appended to the shargs value.

Set the command environment.

Arguments

  • key - The key for the variable.
  • value - The value for the variable.

Execute the Command, returning result 'T'

Arguments

  • execfn - A closure taking a Command, executes it via output or spawn and returns result type T.