aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorLaria Carolin Chabowski <laria@laria.me>2017-08-03 08:08:53 +0200
committerLaria Carolin Chabowski <laria@laria.me>2017-09-26 21:35:40 +0200
commita845956238e6a41479a7abd59f5c39e71f3f85f4 (patch)
treec611d5bebf7659e0d52bae4d3693957856eb1014 /main.go
parent9f8ced40c574054de052849c43f69b66e1e91640 (diff)
downloadpetrific-a845956238e6a41479a7abd59f5c39e71f3f85f4.tar.gz
petrific-a845956238e6a41479a7abd59f5c39e71f3f85f4.tar.bz2
petrific-a845956238e6a41479a7abd59f5c39e71f3f85f4.zip
Implement write-dir
Diffstat (limited to 'main.go')
-rw-r--r--main.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/main.go b/main.go
index c753a01..9057231 100644
--- a/main.go
+++ b/main.go
@@ -11,13 +11,23 @@ import (
type subcmd func(args []string) int
var subcmds = map[string]subcmd{
- "write-dir": notImplementedYet,
+ "write-dir": WriteDir,
"restore-dir": notImplementedYet,
"take-snapshot": notImplementedYet,
"create-snapshot": notImplementedYet,
"list-snapshots": notImplementedYet,
}
+func subcmdUsage(name string, usage string, flags *flag.FlagSet) func() {
+ return func() {
+ fmt.Fprintf(os.Stderr, "Usage: %s %s %s\n", os.Args[0], name, usage)
+ if flags != nil {
+ fmt.Fprintln(os.Stderr, "\nFlags:")
+ flags.PrintDefaults()
+ }
+ }
+}
+
// Global flags
var (
flagConfPath = flag.String("config", "", "Use this config file instead of the default")