From 768c890fcbbfa3512fc3084352b1b583f8518d06 Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 10 Apr 2022 14:20:03 +0200 Subject: [PATCH] check: Deprecate `--check-unused` Unused blobs are not a problem but rather expected to exist now that prune by default does not remove every unused blob. However, the option has caused questions from users whether a repository is damaged or not, so just remove that option. Note that the remaining code is left intact as it is still useful for our test cases. --- cmd/restic/cmd_check.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmd/restic/cmd_check.go b/cmd/restic/cmd_check.go index e32a4a4d0..60c4e19c5 100644 --- a/cmd/restic/cmd_check.go +++ b/cmd/restic/cmd_check.go @@ -57,7 +57,13 @@ func init() { f := cmdCheck.Flags() f.BoolVar(&checkOptions.ReadData, "read-data", false, "read all data blobs") f.StringVar(&checkOptions.ReadDataSubset, "read-data-subset", "", "read a `subset` of data packs, specified as 'n/t' for specific part, or either 'x%' or 'x.y%' or a size in bytes with suffixes k/K, m/M, g/G, t/T for a random subset") - f.BoolVar(&checkOptions.CheckUnused, "check-unused", false, "find unused blobs") + var ignored bool + f.BoolVar(&ignored, "check-unused", false, "find unused blobs") + err := f.MarkDeprecated("check-unused", "`--check-unused` is deprecated and will be ignored") + if err != nil { + // MarkDeprecated only returns an error when the flag is not found + panic(err) + } f.BoolVar(&checkOptions.WithCache, "with-cache", false, "use the cache") }