item: Add slot to take/drop messages

To be more consistent with undo messages, I've added the slot in which
items are involved to take and drop messages. Simple as that.
This commit is contained in:
Lux Aliaga 2022-11-07 18:18:25 -03:00
parent dadb0d721f
commit 833669af3c
Signed by: lux
GPG Key ID: B56C805968637437
1 changed files with 21 additions and 4 deletions

View File

@ -90,10 +90,19 @@ pub fn take(file: &String, slot: &str, message: bool) -> Result<()> {
if message {
println!(
"✅ {} {} {} ",
"✅ {} {} {} {} {} {} {}",
"Took".green(),
&filename.bold(),
format!("from {}", &sourcelocation.to_str().unwrap()).green()
"from".green(),
&sourcelocation.to_str().unwrap(),
"to".green(),
match slot {
"active" => slot.green(),
"inactive" => slot.blue(),
_ => slot.red(),
}
.bold(),
"slot".green()
);
}
@ -168,10 +177,18 @@ pub fn drop(file: &String, slot: &str, dest: PathBuf, message: bool) -> Result<(
if message {
println!(
"✅ {} {} {} ",
"✅ {} {} {} {} {} {}",
"Dropped".green(),
&file.bold(),
format!("into {}", &destpath.to_str().unwrap()).green()
"from".green(),
match slot {
"active" => slot.green(),
"inactive" => slot.blue(),
_ => slot.red(),
}
.bold(),
"slot into".green(),
&destpath.to_str().unwrap()
);
};