|
|
@ -18,11 +18,9 @@ use mods::{
|
|
|
|
use std::{env, process::exit, process::Command};
|
|
|
|
use std::{env, process::exit, process::Command};
|
|
|
|
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
fn main() {
|
|
|
|
// let statements
|
|
|
|
|
|
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
let args: Vec<String> = env::args().collect();
|
|
|
|
let mut pkgs: Vec<String> = env::args().skip(2).collect();
|
|
|
|
let mut pkgs: Vec<String> = env::args().skip(2).collect();
|
|
|
|
|
|
|
|
|
|
|
|
// args catch
|
|
|
|
|
|
|
|
if args.len() <= 1 {
|
|
|
|
if args.len() <= 1 {
|
|
|
|
help();
|
|
|
|
help();
|
|
|
|
exit(1);
|
|
|
|
exit(1);
|
|
|
@ -33,48 +31,37 @@ fn main() {
|
|
|
|
|
|
|
|
|
|
|
|
argssort(&mut pkgs);
|
|
|
|
argssort(&mut pkgs);
|
|
|
|
|
|
|
|
|
|
|
|
// install
|
|
|
|
|
|
|
|
if oper == "-S" || oper == "-Sn" || oper == "ins" {
|
|
|
|
if oper == "-S" || oper == "-Sn" || oper == "ins" {
|
|
|
|
inssort(noconfirm, pkgs);
|
|
|
|
inssort(noconfirm, pkgs);
|
|
|
|
|
|
|
|
|
|
|
|
// remove
|
|
|
|
|
|
|
|
} else if oper == "-R" || oper == "-Rn " || oper == "-Rsn" || oper == "-Rs" || oper == "rm" {
|
|
|
|
} else if oper == "-R" || oper == "-Rn " || oper == "-Rsn" || oper == "-Rs" || oper == "rm" {
|
|
|
|
uninstall(noconfirm, pkgs);
|
|
|
|
uninstall(noconfirm, pkgs);
|
|
|
|
|
|
|
|
|
|
|
|
// upgrade
|
|
|
|
|
|
|
|
} else if oper == "-Syu" || oper == "-Syun" || oper == "upg" {
|
|
|
|
} else if oper == "-Syu" || oper == "-Syun" || oper == "upg" {
|
|
|
|
upgrade(noconfirm);
|
|
|
|
upgrade(noconfirm);
|
|
|
|
|
|
|
|
|
|
|
|
// update
|
|
|
|
|
|
|
|
} else if oper == "-Sy" || oper == "upd" {
|
|
|
|
} else if oper == "-Sy" || oper == "upd" {
|
|
|
|
update();
|
|
|
|
update();
|
|
|
|
|
|
|
|
|
|
|
|
// general search
|
|
|
|
|
|
|
|
} else if oper == "-Ss" || oper == "sea" {
|
|
|
|
} else if oper == "-Ss" || oper == "sea" {
|
|
|
|
r_search(&args[2]);
|
|
|
|
r_search(&args[2]);
|
|
|
|
a_search(&args[2]);
|
|
|
|
a_search(&args[2]);
|
|
|
|
|
|
|
|
|
|
|
|
// aur search
|
|
|
|
|
|
|
|
} else if oper == "-Sa" || oper == "aursea" {
|
|
|
|
} else if oper == "-Sa" || oper == "aursea" {
|
|
|
|
a_search(&args[2]);
|
|
|
|
a_search(&args[2]);
|
|
|
|
|
|
|
|
|
|
|
|
// repo search
|
|
|
|
|
|
|
|
} else if oper == "-Sr" || oper == "repsea" {
|
|
|
|
} else if oper == "-Sr" || oper == "repsea" {
|
|
|
|
r_search(&args[2]);
|
|
|
|
r_search(&args[2]);
|
|
|
|
|
|
|
|
|
|
|
|
// clear cache !! DEBUG ONLY !! DO NOT DO THIS IF YOU DONT KNOW WHAT YOURE DOING !!
|
|
|
|
|
|
|
|
} else if oper == "-Cc" || oper == "clr" {
|
|
|
|
} else if oper == "-Cc" || oper == "clr" {
|
|
|
|
clearcache();
|
|
|
|
clearcache();
|
|
|
|
|
|
|
|
|
|
|
|
// version / contrib
|
|
|
|
|
|
|
|
} else if oper == "-v" || oper == "-V" || oper == "ver" {
|
|
|
|
} else if oper == "-v" || oper == "-V" || oper == "ver" {
|
|
|
|
ver();
|
|
|
|
ver();
|
|
|
|
|
|
|
|
|
|
|
|
// help
|
|
|
|
|
|
|
|
} else if oper == "-h" || oper == "help" {
|
|
|
|
} else if oper == "-h" || oper == "help" {
|
|
|
|
help();
|
|
|
|
help();
|
|
|
|
|
|
|
|
|
|
|
|
// pacman passthrough
|
|
|
|
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
let pass = Command::new("pacman")
|
|
|
|
let pass = Command::new("pacman")
|
|
|
|
.args(env::args().skip(1))
|
|
|
|
.args(env::args().skip(1))
|
|
|
|