fixed up user readability

i18n
jnats 3 years ago
parent ee95ec8d10
commit 5309d4347a

@ -13,5 +13,4 @@ raur = "2.0.2"
runas = "*"
ansi_term = "*"
uwuizer = "*"
text_io = "*"
moins = "*"

@ -4,15 +4,11 @@ use std::{env, fs, path::Path, process::Command};
use crate::{err_unrec, inf, inssort, mods::strs::succ, mods::strs::sec, mods::strs::prompt, mods::uninstall::uninstall};
fn uninstall_make_depend(results: Vec<raur::Package>, pkg: &str) {
let aurpkgname = results[0].name.to_string(); // v here
let aurpkgname = results[0].name.to_string();
let make_depends = raur::info(&[&aurpkgname]).unwrap()[0].make_depends.clone();
if make_depends.len() != 0 {
inf(format!("{} installed following make dependencies:", pkg));
for make_depend in &make_depends {
print!("{} ", make_depend);
}
println!("");
inf(format!("{} installed following make dependencies: {}", pkg, make_depends.join(", ")));
let remove = prompt(format!("Would you like to remove them?"));
if remove == true {
uninstall(true, make_depends);
@ -26,7 +22,6 @@ pub fn clone(noconfirm: bool, pkg: &str) {
let path = Path::new(&cachedir);
let pkgdir = format!("{}/{}", &cachedir, &pkg);
let results = raur::search(&pkg).unwrap();
let mut succ_install: bool = false;
if results.len() == 0 {
err_unrec(format!("No matching AUR packages found"));
@ -110,8 +105,6 @@ pub fn clone(noconfirm: bool, pkg: &str) {
.status();
match install_result {
Ok(_) => {
//succ(format!("Succesfully installed {}", pkg));
//succ_install = true;
uninstall_make_depend(results, pkg);
}
Err(_) => {

@ -14,7 +14,7 @@ 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."));
err_rec(format!("Appending 'n' where (n) is present passes '--noconfirm' to pacman. Use at your own risk. (alternatively, using '--noconfirm' as a flag works too.)"));
println!("");
}

@ -1,7 +1,6 @@
use ansi_term::Colour;
use std::{process, env};
use std::{process, env, io, io::Write};
use uwuizer::*;
use text_io::read;
pub fn inf(a: std::string::String){
if env::var("AME_UWU").unwrap_or("n/a".to_string()) == "YES" {
@ -41,23 +40,27 @@ pub fn succ(a: std::string::String) {
pub fn prompt(a: std::string::String) -> bool {
if env::var("AME_UWU").unwrap_or("n/a".to_string()) == "YES" {
println!("{} {} {}",
print!("{} {} {}",
Colour::Purple.bold().paint("❖"),
Colour::White.bold().paint(uwuize!(&a)),
Colour::White.bold().paint("(Y/n): "));
let yn: String = read!();
if yn == "n" || yn == "N" || yn == "no" || yn == "No" {
io::stdout().flush().ok().expect("Couldn't flush stdout");
let mut yn: String = String::new();
let _ = std::io::stdin().read_line(&mut yn);
if yn.trim() == "n" || yn.trim() == "N" || yn.trim() == "no" || yn.trim() == "No" {
false
} else {
true
}
} else {
println!("{} {} {}",
print!("{} {} {}",
Colour::Purple.bold().paint("❖"),
Colour::White.bold().paint(&a),
Colour::White.bold().paint("(Y/n): "));
let yn: String = read!();
if yn == "n" || yn == "N" || yn == "no" || yn == "No" {
io::stdout().flush().ok().expect("Couldn't flush stdout");
let mut yn: String = String::new();
let _ = std::io::stdin().read_line(&mut yn);
if yn.trim() == "n" || yn.trim() == "N" || yn.trim() == "no" || yn.trim() == "No" {
false
} else {
true

Loading…
Cancel
Save