diff options
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -11,11 +11,12 @@ import ( type subcmd func(args []string) int var subcmds = map[string]subcmd{ - "write-dir": WriteDir, - "restore-dir": RestoreDir, - "take-snapshot": notImplementedYet, - "create-snapshot": notImplementedYet, - "list-snapshots": notImplementedYet, + "write-dir": WriteDir, + "restore-dir": RestoreDir, + "take-snapshot": TakeSnapshot, + "create-snapshot": CreateSnapshot, + "list-snapshots": ListSnapshots, + "restore-snapshot": RestoreSnapshot, } func subcmdUsage(name string, usage string, flags *flag.FlagSet) func() { @@ -28,6 +29,12 @@ func subcmdUsage(name string, usage string, flags *flag.FlagSet) func() { } } +func subcmdErrout(name string) func(error) { + return func(err error) { + fmt.Fprintf(os.Stderr, "%s: %s\n", name, err) + } +} + // Global flags var ( flagConfPath = flag.String("config", "", "Use this config file instead of the default") @@ -116,8 +123,3 @@ func loadConfig() bool { objectstore = s return true } - -func notImplementedYet(_ []string) int { - fmt.Fprintln(os.Stderr, "Not implemented yet") - return 1 -} |