From 1c77c51a03f583d2e5169665e74b47668a2fe35c Mon Sep 17 00:00:00 2001 From: Michael Eischer Date: Sun, 28 Jan 2024 16:21:22 +0100 Subject: [PATCH] features: initialize based on RESTIC_FEATURES environment variable --- cmd/restic/main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cmd/restic/main.go b/cmd/restic/main.go index b31ce1bb4..1a11abc40 100644 --- a/cmd/restic/main.go +++ b/cmd/restic/main.go @@ -14,6 +14,7 @@ import ( "github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/errors" + "github.com/restic/restic/internal/feature" "github.com/restic/restic/internal/options" "github.com/restic/restic/internal/restic" ) @@ -103,10 +104,16 @@ func main() { // we can show the logs log.SetOutput(logBuffer) + err := feature.Flag.Apply(os.Getenv("RESTIC_FEATURES")) + if err != nil { + fmt.Fprintln(os.Stderr, err) + Exit(1) + } + debug.Log("main %#v", os.Args) debug.Log("restic %s compiled with %v on %v/%v", version, runtime.Version(), runtime.GOOS, runtime.GOARCH) - err := cmdRoot.ExecuteContext(internalGlobalCtx) + err = cmdRoot.ExecuteContext(internalGlobalCtx) switch { case restic.IsAlreadyLocked(err):