initial implementation of pacman command passthrough

i18n
jnats 3 years ago
parent 24c13a89bd
commit 9f60a04bc5

@ -1,6 +1,6 @@
mod mods;
use mods::{clearcache::clearcache, clone::clone, help::help, install::install, search::{a_search, r_search}, uninstall::uninstall, upgrade::upgrade, update::update, ver::ver, strs::inf, strs::err_unrec};
use mods::{clearcache::clearcache, clone::clone, help::help, install::install, search::{a_search, r_search}, uninstall::uninstall, upgrade::upgrade, update::update, ver::ver, strs::inf, strs::err_unrec, strs::err_rec};
use std::{env, process::exit, process::Command, process::Stdio};
fn main() {
@ -114,8 +114,24 @@ fn main() {
ver();
// help
} else {
} else if oper == "-h" || oper == "help" {
help();
exit(0);
// pacman passthrough
} else {
let pass = Command::new("pacman")
.args(env::args().skip(1))
.status()
.expect("Something has gone wrong.");
match pass.code() {
Some(1) => {
err_rec(format!("No such operation \"{}\"", args.join(" ")));
inf(format!("Try running \"ame help\" for an overview of how to use ame"))
}
Some(_) => {}
None => {
err_unrec(format!("Something has gone terribly wrong."))
}}
}
}

@ -10,7 +10,9 @@ ame -Syu(n) / upg - upgrade all packages to latest version
ame -Ss / sea <pkg> - search for a package
ame -Sa / aursea <pkg> - search for a package in the aur
ame -Sr / repsea <pkg> - search for a package in the repos
ame -v / ver - contributors and version info");
ame -v / ver - contributors and version info
ame <any valid pacman flags> - passes said flags to be processed by pacman");
println!("");
err_rec(format!("Appending 'n' where (n) is present passes '--noconfirm' to pacman. Use at your own risk."));
println!("");

@ -3,7 +3,7 @@ use ansi_term::Colour;
pub fn ver() {
println!("");
inf(format!("ame - v2.1.2"));
inf(format!("ame - v2.2.0"));
println!("");
inf(format!("Contributors:"));
println!("- axtlos <axtlos@salyut.one>");

Loading…
Cancel
Save