Restructure cmd/restic, no functional changes

This commit is contained in:
Alexander Neumann
2015-06-21 17:40:22 +02:00
parent 2fa259816b
commit 4388474cdc
16 changed files with 309 additions and 264 deletions
+5 -3
View File
@@ -15,13 +15,15 @@ import (
"github.com/restic/restic/repository"
)
type CmdDump struct{}
type CmdDump struct {
global *MainOptions
}
func init() {
_, err := parser.AddCommand("dump",
"dump data structures",
"The dump command dumps data structures from a repository as JSON documents",
&CmdDump{})
&CmdDump{global: &mainOpts})
if err != nil {
panic(err)
}
@@ -102,7 +104,7 @@ func (cmd CmdDump) Execute(args []string) error {
return fmt.Errorf("type not specified, Usage: %s", cmd.Usage())
}
repo, err := OpenRepo()
repo, err := cmd.global.OpenRepository()
if err != nil {
return err
}