#command #programs #wraps #execution #execute #run-command #status

execute-command

A simple Rust package that wraps Command to simplify the execution of programs

2 unstable releases

0.3.0 Apr 22, 2023
0.2.0 Apr 20, 2023
0.1.0 Apr 19, 2023
0.0.0 Apr 19, 2023

#16 in #wraps

Download history 1/week @ 2024-03-14 9/week @ 2024-03-21 14/week @ 2024-03-28 13/week @ 2024-04-04

302 downloads per month

MIT license

10KB
174 lines

crates.io Documentation CI

execute-command

A simple Rust package that wraps Command to simplify the execution of programs.

Usage

Basic functions:

use execute_command as exec;

let mut command = exec::parse("echo 1").unwrap();
let status = exec::status("echo 1").unwrap();
let output = exec::output("echo 1").unwrap();
let string = exec::string("echo 1").unwrap();

Extending Command:

use execute_command::ExecuteCommand;
use std::process::Command;

let mut command = Command::parse("echo 1").unwrap();
let status = Command::parse("echo 1").unwrap().execute_status().unwrap();
let output = Command::parse("echo 1").unwrap().execute_output().unwrap();
let string = Command::parse("echo 1").unwrap().execute_string().unwrap();

Note that these functions will return an error if the program exits with a non-zero status code.

Dependencies

~330–800KB
~19K SLoC