From 37a63a5a85943f53287a9e3bf901708fcf27a91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Sun, 30 Jun 2024 15:04:28 -0700 Subject: [PATCH] trash files without showing table when run with no command trash command still shows table --- main.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 2102eca..180d655 100644 --- a/main.go +++ b/main.go @@ -98,7 +98,15 @@ var ( } if len(ctx.Args().Slice()) != 0 { - return doTrash.Action(ctx) + var files_to_trash files.Files + for _, arg := range ctx.Args().Slice() { + file, e := files.New(arg) + if e != nil { + log.Fatalf("cannot trash '%s': No such file or directory", arg) + } + files_to_trash = append(files_to_trash, file) + } + return confirmTrash(files_to_trash) } else { return interactiveMode() }