trash files without showing table when run with no command

trash command still shows table
This commit is contained in:
Lilian Jónsdóttir 2024-06-30 15:04:28 -07:00
parent a8978790eb
commit 37a63a5a85

10
main.go
View file

@ -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()
}