From 6ad43bbf822360be07106b075c10ec181bff822f Mon Sep 17 00:00:00 2001 From: Lux Aliaga Date: Thu, 3 Nov 2022 19:08:50 -0300 Subject: [PATCH] src: Remove periods from end of sentences For many messages there were some consistency issues in terms of punctuation. I've fixed this issue by removing every period from every sentence. --- src/bin/vento.rs | 2 +- src/help.rs | 2 +- src/inv.rs | 8 ++++---- src/item.rs | 14 +++++++------- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/bin/vento.rs b/src/bin/vento.rs index c5db584..d2bc886 100644 --- a/src/bin/vento.rs +++ b/src/bin/vento.rs @@ -43,7 +43,7 @@ fn main() -> Result<()> { "-s" => match args.len() { 4 => inv::list(&args[2], &args[3])?, 3 => inv::list(&args[2], "")?, - 2 => bail!("{}", "You need to specify a slot.".red()), + 2 => bail!("{}", "You need to specify a slot".red()), _ => bail!("{}", "Too many arguments".red()), }, _ => inv::list("active", args[1].as_str())?, diff --git a/src/help.rs b/src/help.rs index b31f6f9..e0052b0 100644 --- a/src/help.rs +++ b/src/help.rs @@ -71,7 +71,7 @@ pub fn drop() -> Result<()> { © 2022 Lux Aliaga. Licensed under GPLv3 {} - - {}: Takes a file off the inventory and drops it. + - {}: Takes a file off the inventory and drops it - {}: Displays this message", "Drop".bold().blue(), "Usage:".bold(), diff --git a/src/inv.rs b/src/inv.rs index 37d769b..c5ff0cf 100644 --- a/src/inv.rs +++ b/src/inv.rs @@ -53,7 +53,7 @@ pub fn list(slot: &str, dir: &str) -> Result<()> { // Detects if Vento hasn't been initialized and bails if so bail!( "{}", - "Vento not initialized. Run \"vento -i\" to initialize Vento.".red() + "Vento not initialized. Run \"vento -i\" to initialize Vento".red() ); } @@ -70,7 +70,7 @@ pub fn list(slot: &str, dir: &str) -> Result<()> { if dir.to_string().contains("..") { // Basically preventing from listing anything out of bounds. ls and dir exist for that - bail!("{}", "Cannot access parent.".red()); + bail!("{}", "Cannot access parent".red()); } if !slotdir.is_dir() { @@ -78,7 +78,7 @@ pub fn list(slot: &str, dir: &str) -> Result<()> { bail!( "{}", format!( - "No such slot or directory. Valid slots are {} and {}.", + "No such slot or directory. Valid slots are {} and {}", "active".green().bold(), "inactive".blue().bold() ) @@ -91,7 +91,7 @@ pub fn list(slot: &str, dir: &str) -> Result<()> { println!( "🗃️ {}", format!( - "No files in {}{}.", + "No files in {}{}", match slot { "active" => slot.bold(), _ => slot.blue().bold(), diff --git a/src/item.rs b/src/item.rs index 59233c7..e592654 100644 --- a/src/item.rs +++ b/src/item.rs @@ -32,7 +32,7 @@ pub fn take(file: &String, slot: &str, message: bool) -> Result<()> { // Detects if Vento hasn't been initialized and bails if so bail!( "{}", - "Vento not initialized. Run \"vento -i\" to initialize Vento.".red() + "Vento not initialized. Run \"vento -i\" to initialize Vento".red() ); }; let slotdir: PathBuf = match slot { @@ -46,7 +46,7 @@ pub fn take(file: &String, slot: &str, message: bool) -> Result<()> { bail!( "{}", format!( - "No such slot. Valid slots are {} and {}.", + "No such slot. Valid slots are {} and {}", "active".green().bold(), "inactive".blue().bold() ) @@ -78,7 +78,7 @@ pub fn take(file: &String, slot: &str, message: bool) -> Result<()> { let options = CopyOptions::new(); move_dir(&file, &slotdir, &options)?; } else { - bail!("{}", "No such file or directory.".red()); + bail!("{}", "No such file or directory".red()); } common::history(common::HistoryData { @@ -109,7 +109,7 @@ pub fn drop(file: &String, slot: &str, dest: PathBuf, message: bool) -> Result<( // Detects if Vento hasn't been initialized and bails if so bail!( "{}", - "Vento not initialized. Run \"vento -i\" to initialize Vento.".red() + "Vento not initialized. Run \"vento -i\" to initialize Vento".red() ); }; @@ -124,7 +124,7 @@ pub fn drop(file: &String, slot: &str, dest: PathBuf, message: bool) -> Result<( bail!( "{}", format!( - "No such slot. Valid slots are {} and {}.", + "No such slot. Valid slots are {} and {}", "active".green().bold(), "inactive".blue().bold() ) @@ -142,7 +142,7 @@ pub fn drop(file: &String, slot: &str, dest: PathBuf, message: bool) -> Result<( if Path::exists(&destpath) { // Checks if there's a file with the same name in the destination path. - bail!("{}", "A file with the same name already exists in the destination! Try renaming it or dropping this file somewhere else.".red()); + bail!("{}", "A file with the same name already exists in the destination! Try renaming it or dropping this file somewhere else".red()); } if sourcepath.is_file() | sourcepath.is_symlink() { @@ -154,7 +154,7 @@ pub fn drop(file: &String, slot: &str, dest: PathBuf, message: bool) -> Result<( let options = CopyOptions::new(); move_dir(&sourcepath, &destpath, &options)?; } else { - bail!("{}", "No such file or directory.".red()); + bail!("{}", "No such file or directory".red()); } destpath.pop();