From 07fb372398d1f103b14b988092b84d333fed6319 Mon Sep 17 00:00:00 2001 From: Anis Eleuch Date: Sun, 19 Mar 2023 00:39:26 +0100 Subject: [PATCH] rm: --dry-run with --versions to print versions modtime (#4495) --- cmd/rm-main.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/rm-main.go b/cmd/rm-main.go index 402e3297..0c5c9140 100644 --- a/cmd/rm-main.go +++ b/cmd/rm-main.go @@ -361,7 +361,7 @@ func removeSingle(url, versionID string, opts removeOpts) error { printMsg(msg) } } else { - printDryRunMsg(content) + printDryRunMsg(content, opts.withVersions) } return nil } @@ -381,12 +381,12 @@ type removeOpts struct { encKeyDB map[string][]prefixSSEPair } -func printDryRunMsg(content *ClientContent) { +func printDryRunMsg(content *ClientContent, printModTime bool) { if globalJSON { return } - if content.VersionID != "" { - fmt.Println("DRYRUN: Removing ", content.URL.Path, "version:", content.VersionID) + if printModTime { + fmt.Println("DRYRUN: Removing ", content.VersionID, content.Time.Format(printDate), content.URL.Path) return } fmt.Println("DRYRUN: Removing ", content.URL.Path) @@ -472,7 +472,7 @@ func listAndRemove(url string, opts removeOpts) error { } if opts.isFake { - printDryRunMsg(content) + printDryRunMsg(content, true) continue } @@ -568,7 +568,7 @@ func listAndRemove(url string, opts removeOpts) error { } } } else { - printDryRunMsg(content) + printDryRunMsg(content, opts.withVersions) } } @@ -593,7 +593,7 @@ func listAndRemove(url string, opts removeOpts) error { } if opts.isFake { - printDryRunMsg(content) + printDryRunMsg(content, true) continue }