From e7e7b79e99875ee3e9dcc679763156b1b24fc5a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Mon, 15 Jul 2024 21:31:59 -0700 Subject: [PATCH] improve trashed message --- internal/files/trash.go | 1 + main.go | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/files/trash.go b/internal/files/trash.go index d2d0436..ceaf8fb 100644 --- a/internal/files/trash.go +++ b/internal/files/trash.go @@ -84,6 +84,7 @@ func FindTrash(trashdir, ogdir string, f *filter.Filter) (files Files, outerr er trashedpath := strings.Replace(strings.Replace(path, "info", "files", 1), trash_info_ext, "", 1) info, err := os.Stat(trashedpath) if err != nil { + // TODO: do something about it log.Errorf("error reading %s: %s", trashedpath, err) return nil } diff --git a/main.go b/main.go index e022abc..8164adb 100644 --- a/main.go +++ b/main.go @@ -536,7 +536,13 @@ func confirmTrash(fs files.Files) error { if err != nil { return err } - fmt.Printf("trashed %d files\n", trashed) + var f string + if trashed == 1 { + f = "file" + } else { + f = "files" + } + fmt.Printf("trashed %d %s\n", trashed, f) } else { fmt.Printf("not doing anything\n") return nil