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") }