From 92a74b0283e28b507f74ade92fa4b8482a44b76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lilian=20J=C3=B3nsd=C3=B3ttir?= Date: Fri, 28 Jun 2024 11:30:23 -0700 Subject: [PATCH] select all if filenames are used when trashing --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index ecfd185..2102eca 100644 --- a/main.go +++ b/main.go @@ -133,6 +133,7 @@ var ( Before: beforeTrash, Action: func(ctx *cli.Context) error { var files_to_trash files.Files + var selectall bool for _, arg := range ctx.Args().Slice() { file, e := files.New(arg) if e != nil { @@ -141,6 +142,7 @@ var ( continue } files_to_trash = append(files_to_trash, file) + selectall = true } // if none of the args were files, then process find files based on filter @@ -154,10 +156,11 @@ var ( return nil } files_to_trash = append(files_to_trash, fls...) + selectall = !f.Blank() } log.Debugf("what is workdir? it's %s", workdir) - indices, err := tables.FilesTable(files_to_trash, termwidth, termheight, false, !f.Blank(), workdir) + indices, err := tables.FilesTable(files_to_trash, termwidth, termheight, false, selectall, workdir) if err != nil { return err }