mirror of https://github.com/restic/restic.git
cleanup backend initialization
This commit is contained in:
parent
c752867f0a
commit
d378a171c8
|
@ -148,11 +148,12 @@ func (opts *GlobalOptions) AddFlags(f *pflag.FlagSet) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var globalOptions = GlobalOptions{
|
var globalOptions = GlobalOptions{
|
||||||
stdout: os.Stdout,
|
stdout: os.Stdout,
|
||||||
stderr: os.Stderr,
|
stderr: os.Stderr,
|
||||||
|
backends: collectBackends(),
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func collectBackends() *location.Registry {
|
||||||
backends := location.NewRegistry()
|
backends := location.NewRegistry()
|
||||||
backends.Register(azure.NewFactory())
|
backends.Register(azure.NewFactory())
|
||||||
backends.Register(b2.NewFactory())
|
backends.Register(b2.NewFactory())
|
||||||
|
@ -163,7 +164,7 @@ func init() {
|
||||||
backends.Register(s3.NewFactory())
|
backends.Register(s3.NewFactory())
|
||||||
backends.Register(sftp.NewFactory())
|
backends.Register(sftp.NewFactory())
|
||||||
backends.Register(swift.NewFactory())
|
backends.Register(swift.NewFactory())
|
||||||
globalOptions.backends = backends
|
return backends
|
||||||
}
|
}
|
||||||
|
|
||||||
func stdinIsTerminal() bool {
|
func stdinIsTerminal() bool {
|
||||||
|
|
Loading…
Reference in New Issue