pub fn command<P>(&self, cmd: P) -> Result<Command, Error>
    where
        P: AsRef<str>,
    {
        // Lookup shell.
        let shell: &OsStr = self.shell.as_ref();
        let mut command = Command::new(shell);

        // Prefix `command` with the strings we need to call the shell.
        let cmd = cmd.as_ref();
        let execstring_args = self
            .shell
            .execstring_args()
            .map_err(|e| anyhow!("Could not find a shell string: {}", e))?;
        let args = execstring_args.iter().chain(std::iter::once(&cmd));

        command.args(args);
        command.stdout(Stdio::piped());
        command.stderr(Stdio::piped());

        Ok(command)
    }
/// Prepare a `Command` from a script.
///
/// The resulting `Command` will be ready to execute in the shell.
/// You may customize it with e.g. `env()`.
Prepare a `Command` from a script.
The resulting `Command` will be ready to execute in the shell.
You may customize it with e.g.
Prepare a ` Command ` from a script . The resulting ` Command ` will be ready to execute in the shell . You may customize it with e . g .
pub fn command<P>(&self, cmd: P) -> Result<Command, Error>
    where
        P: AsRef<str>,
    {
        // Lookup shell.
        let shell: &OsStr = self.shell.as_ref();
        let mut command = Command::new(shell);
        // Prefix `command` with the strings we need to call the shell.
        let cmd = cmd.as_ref();
        let execstring_args = self
            .shell
            .execstring_args()
            .map_err(|e| anyhow!("Could not find a shell string: {}", e))?;
        let args = execstring_args.iter().chain(std::iter::once(&cmd));
        command.args(args);
        command.stdout(Stdio::piped());
        command.stderr(Stdio::piped());
        Ok(command)
    }
pub fn command < P > ( & self , cmd : P ) -> Result < Command , Error > where P : AsRef < str > , { // Lookup shell. let shell : & OsStr = self . shell . as_ref ( ) ; let mut command = Command :: new ( shell ) ; // Prefix `command` with the strings we need to call the shell. let cmd = cmd . as_ref ( ) ; let execstring_args = self . shell . execstring_args ( ) . map_err ( | e | anyhow ! ( " " e ) ) ? ; let args = execstring_args . iter ( ) . chain ( std :: iter :: once ( & cmd ) ) ; command . args ( args ) ; command . stdout ( Stdio :: piped ( ) ) ; command . stderr ( Stdio :: piped ( ) ) ; Ok ( command ) }
Prepare a `Command` from a script.
Prepare a ` Command ` from a script .
&self
cmd
P
&self
cmd
P