fixes in t k usability

This commit is contained in:
Abraham Toriz 2021-07-30 18:01:00 -05:00
parent 63154cc1fc
commit b3864f3b95
No known key found for this signature in database
GPG Key ID: D5B4A746DB5DD42A
1 changed files with 4 additions and 2 deletions

View File

@ -48,7 +48,8 @@ impl<'a> Command<'a> for KillCommand {
match args {
Args::Id(id) => {
if let Some(entry) = db.entry_by_id(id)? {
writeln!(out, "are you sure you want to delete entry {}? ({}) [y/n]", entry.id, entry.note.unwrap_or("".into()))?;
write!(out, "are you sure you want to delete entry {}? ({}) [y/n] ", entry.id, entry.note.unwrap_or("".into()))?;
io::stdout().flush()?;
if read_line().to_lowercase().starts_with("y") {
db.delete_entry_by_id(id)?;
@ -63,7 +64,8 @@ impl<'a> Command<'a> for KillCommand {
Args::Sheet(sheet) => {
let n = db.entries_by_sheet(&sheet, None, None)?.len();
writeln!(out, "are you sure you want to delete {} entries on sheet \"{}\"?", n, sheet)?;
write!(out, "are you sure you want to delete {} entries on sheet \"{}\"? [y/n] ", n, sheet)?;
io::stdout().flush()?;
if read_line().to_lowercase().starts_with("y") {
db.delete_entries_in_sheet(&sheet)?;