string consistency

i18n
michal 2 years ago
parent 4376b8efbf
commit f045f86f3e

@ -9,7 +9,7 @@ pub fn add(pkg: Package, options: Options) {
"{}/.local/share/ame/db.sqlite",
env::var("HOME").unwrap()
)))
.expect("Couldn't connect to database.");
.expect("Couldn't connect to database");
if options.verbosity >= 1 {
eprintln!("Adding package {} to database", pkg.name);

@ -15,7 +15,7 @@ pub fn query(a: &str, options: Options) -> Vec<Package> {
"{}/.local/share/ame/db.sqlite",
env::var("HOME").unwrap()
)))
.expect("Couldn't connect to database.");
.expect("Couldn't connect to database");
if verbosity >= 1 {
eprintln!("Querying database for input")
@ -44,7 +44,7 @@ pub fn query(a: &str, options: Options) -> Vec<Package> {
.collect::<Vec<String>>(),
})
})
.expect("Couldn't query database for packages.");
.expect("Couldn't query database for packages");
if verbosity >= 1 {
eprintln!("Retrieved results");

@ -8,7 +8,7 @@ pub fn remove(pkg: &str, options: Options) {
"{}/.local/share/ame/db.sqlite",
env::var("HOME").unwrap()
)))
.expect("Couldn't connect to database.");
.expect("Couldn't connect to database");
let verbosity = options.verbosity;
@ -24,5 +24,5 @@ pub fn remove(pkg: &str, options: Options) {
WHERE name = ?);",
[pkg],
)
.expect("Couldn't delete package from database.");
.expect("Couldn't delete package from database");
}

@ -30,21 +30,21 @@ pub fn sort(input: &[String], options: Options) -> structs::Sorted {
.arg(format!("^{}$", &b))
.stdout(Stdio::null())
.status()
.expect("Something has gone wrong.");
.expect("Something has gone wrong");
if rpc::rpcinfo(b.to_string()).found {
if verbosity >= 1 {
eprintln!("{} found in AUR.", b);
eprintln!("{} found in AUR", b);
}
aur.push(b.to_string());
} else if let Some(0) = rs.code() {
if verbosity >= 1 {
eprintln!("{} found in repos.", b)
eprintln!("{} found in repos", b)
}
repo.push(b.to_string());
} else {
if verbosity >= 1 {
eprintln!("{} not found.", b);
eprintln!("{} not found", b);
}
nf.push(b.to_string());
}

@ -12,7 +12,7 @@ fn main() {
}
if unsafe { geteuid() } == 0 {
panic!("Running amethyst as root is disallowed as it can lead to system breakage. Instead, amethyst will prompt you when it needs superuser permissions.")
panic!("Running amethyst as root is disallowed as it can lead to system breakage. Instead, amethyst will prompt you when it needs superuser permissions")
}
let matches = App::new("Amethyst")
@ -58,7 +58,7 @@ fn main() {
)
.subcommand(
SubCommand::with_name("search")
.about("Searches for the relevant packages in both the AUR and repos.")
.about("Searches for the relevant packages in both the AUR and repos")
.aliases(&["-Ss", "sea"])
.arg(
Arg::with_name("aur")
@ -125,7 +125,7 @@ fn main() {
}
if !sorted.nf.is_empty() {
eprintln!(
"Couldn't find packages: {} in repos or the AUR.",
"Couldn't find packages: {} in repos or the AUR",
sorted.nf.join(", ")
);
}

@ -44,7 +44,7 @@ pub fn aur_install(a: Vec<String>, options: Options) {
.arg("clone")
.arg(format!("{}/{}", url, pkg))
.status()
.expect("Something has gone wrong.");
.expect("Something has gone wrong");
if verbosity >= 1 {
eprintln!(
@ -73,7 +73,7 @@ pub fn aur_install(a: Vec<String>, options: Options) {
if !sorted.nf.is_empty() {
panic!(
"Could not find dependencies {} for package {}. Aborting",
"Could not find dependencies {} for package {}, aborting",
sorted.nf.join(", "),
pkg
);
@ -107,7 +107,7 @@ pub fn aur_install(a: Vec<String>, options: Options) {
Command::new("makepkg")
.args(&makepkg_args)
.status()
.expect("Something has gone wrong.");
.expect("Something has gone wrong");
if makepkg_args.contains(&"--asdeps") {
set_current_dir(&cachedir).unwrap();

@ -32,7 +32,7 @@ pub fn install(mut a: Vec<String>, options: Options) {
if let Some(x) = r.code() {
if verbosity >= 1 {
eprintln!("Installing packages: {:?} exited with code {}.", &b, x)
eprintln!("Installing packages: {:?} exited with code {}", &b, x)
}
}
}

@ -7,7 +7,7 @@ pub fn aur_search(a: &str, options: Options) {
let res = rpcsearch(a.to_string());
if verbosity >= 1 {
eprintln!("Found {} results for \"{}\" in AUR.", res.resultcount, a);
eprintln!("Found {} results for \"{}\" in AUR", res.resultcount, a);
}
for r in &res.results {
@ -17,7 +17,7 @@ pub fn aur_search(a: &str, options: Options) {
r.version,
r.description
.as_ref()
.unwrap_or(&"No description.".to_string())
.unwrap_or(&"No description".to_string())
)
}
}
@ -28,13 +28,13 @@ pub fn repo_search(a: &str, options: Options) {
.arg("-Ss")
.arg(format!("^{}$", &a))
.output()
.expect("Something has gone wrong.");
.expect("Something has gone wrong");
let str = String::from_utf8(rs.stdout).unwrap();
if verbosity >= 1 {
eprintln!(
"Found {} results for \"{}\" in repos.",
"Found {} results for \"{}\" in repos",
&str.split('\n').count() / 2,
&a
);

@ -26,11 +26,11 @@ pub fn uninstall(mut a: Vec<String>, options: Options) {
.arg("-Rs")
.args(&a)
.status()
.expect("Something has gone wrong.");
.expect("Something has gone wrong");
if let Some(x) = r.code() {
if verbosity >= 1 {
eprintln!("Uninstalling packages: {:?} exited with code {}.", &b, x)
eprintln!("Uninstalling packages: {:?} exited with code {}", &b, x)
}
}

@ -19,7 +19,7 @@ pub fn upgrade(options: Options) {
Command::new("pacman")
.args(&pacman_args)
.status()
.expect("Something has gone wrong.");
.expect("Something has gone wrong");
if verbosity >= 1 {
eprintln!("Upgrading AUR packages")

Loading…
Cancel
Save