wei-kill 0.1.3

kill process by name, pid or port number
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
pub fn kill(name: &str) -> Result<String,String> {
    let output = std::process::Command::new("pkill")
        .arg(name)
        .output()
        .expect("failed to execute process");

    if output.status.success() {
        Ok(String::from_utf8(output.stdout).unwrap())
    } else {
        Err(String::from_utf8(output.stderr).unwrap())
    }
}