fn build_command(
        args: &[OsString],
        input_conf: &InputConf,
        output_conf: &OutputConf,
    ) -> io::Result<Command> {
        let mut args = args.iter();
        let mut command = Command::new(args.next().unwrap());
        command.args(args);
        command.stderr(Stdio::piped());

        input_conf.prepare_input_file()?;
        if let InputConf::StdIn(_) = input_conf {
            command.stdin(File::open(input_conf.input_path())?);
        } else {
            command.stdin(Stdio::null());
        }

        if let OutputConf::Named(output) = output_conf {
            command.stdout(Stdio::null());
            Self::create_named_pipe(output)?;
        } else {
            command.stdout(Stdio::piped());
        }

        Ok(command)
    }
/// Builds the `Command` struct from the parsed arguments
Builds the `Command` struct from the parsed arguments
Builds the ` Command ` struct from the parsed arguments
fn build_command(
        args: &[OsString],
        input_conf: &InputConf,
        output_conf: &OutputConf,
    ) -> io::Result<Command> {
        let mut args = args.iter();
        let mut command = Command::new(args.next().unwrap());
        command.args(args);
        command.stderr(Stdio::piped());
        input_conf.prepare_input_file()?;
        if let InputConf::StdIn(_) = input_conf {
            command.stdin(File::open(input_conf.input_path())?);
        } else {
            command.stdin(Stdio::null());
        }
        if let OutputConf::Named(output) = output_conf {
            command.stdout(Stdio::null());
            Self::create_named_pipe(output)?;
        } else {
            command.stdout(Stdio::piped());
        }
        Ok(command)
    }
fn build_command ( args : & [ OsString ] , input_conf : & InputConf , output_conf : & OutputConf , ) -> io :: Result < Command > { let mut args = args . iter ( ) ; let mut command = Command :: new ( args . next ( ) . unwrap ( ) ) ; command . args ( args ) ; command . stderr ( Stdio :: piped ( ) ) ; input_conf . prepare_input_file ( ) ? ; if let InputConf :: StdIn ( _ ) = input_conf { command . stdin ( File :: open ( input_conf . input_path ( ) ) ? ) ; } else { command . stdin ( Stdio :: null ( ) ) ; } if let OutputConf :: Named ( output ) = output_conf { command . stdout ( Stdio :: null ( ) ) ; Self :: create_named_pipe ( output ) ? ; } else { command . stdout ( Stdio :: piped ( ) ) ; } Ok ( command ) }
Builds the `Command` struct from the parsed arguments
Builds the ` Command ` struct from the parsed arguments
args
&[OsString]
input_conf
&InputConf
output_conf
&OutputConf
args
&[OsString]
input_conf
&InputConf
output_conf
&OutputConf