2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-23 21:27:34 +00:00

features: initialize based on RESTIC_FEATURES environment variable

This commit is contained in:
Michael Eischer 2024-01-28 16:21:22 +01:00
parent 5974a79497
commit 1c77c51a03

View File

@ -14,6 +14,7 @@ import (
"github.com/restic/restic/internal/debug" "github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors" "github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/feature"
"github.com/restic/restic/internal/options" "github.com/restic/restic/internal/options"
"github.com/restic/restic/internal/restic" "github.com/restic/restic/internal/restic"
) )
@ -103,10 +104,16 @@ func main() {
// we can show the logs // we can show the logs
log.SetOutput(logBuffer) 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("main %#v", os.Args)
debug.Log("restic %s compiled with %v on %v/%v", debug.Log("restic %s compiled with %v on %v/%v",
version, runtime.Version(), runtime.GOOS, runtime.GOARCH) version, runtime.Version(), runtime.GOOS, runtime.GOARCH)
err := cmdRoot.ExecuteContext(internalGlobalCtx) err = cmdRoot.ExecuteContext(internalGlobalCtx)
switch { switch {
case restic.IsAlreadyLocked(err): case restic.IsAlreadyLocked(err):