mirror of
https://github.com/restic/restic.git
synced 2026-07-10 17:25:08 +00:00
features: print warning for stable/depreacted feature flags
This commit is contained in:
@@ -57,7 +57,7 @@ func (f *FlagSet) SetFlags(flags map[FlagName]FlagDesc) {
|
||||
}
|
||||
}
|
||||
|
||||
func (f *FlagSet) Apply(flags string) error {
|
||||
func (f *FlagSet) Apply(flags string, logWarning func(string)) error {
|
||||
if flags == "" {
|
||||
return nil
|
||||
}
|
||||
@@ -92,9 +92,9 @@ func (f *FlagSet) Apply(flags string) error {
|
||||
case Alpha, Beta:
|
||||
f.enabled[fname] = value
|
||||
case Stable:
|
||||
// FIXME print warning
|
||||
logWarning(fmt.Sprintf("feature flag %q is always enabled and will be removed in a future release", fname))
|
||||
case Deprecated:
|
||||
// FIXME print warning
|
||||
logWarning(fmt.Sprintf("feature flag %q is always disabled and will be removed in a future release", fname))
|
||||
default:
|
||||
panic("unknown feature phase")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user