You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
562 B
Rust
18 lines
562 B
Rust
use std::{ops::Deref, process::Command};
|
|
|
|
pub fn a_search(pkg: &str) {
|
|
let results = raur::search(&pkg);
|
|
for res in &results {
|
|
println!("aur/{} {}\n {}", res[0].name, res[0].version, res[0].description.as_ref().map_or("n/a", String::deref));
|
|
}
|
|
}
|
|
|
|
pub fn r_search(pkg: &str) {
|
|
let errstr = format!("Something happened");
|
|
Command::new("pacman")
|
|
.arg("-Ss")
|
|
.arg(&pkg)
|
|
.spawn()
|
|
//.status() TODO: for some reason cant use both .spawn and .status at the same time, need fix
|
|
.expect(&errstr);
|
|
} |