diff options
author | Laria Carolin Chabowski <laria@laria.me> | 2017-08-03 08:08:53 +0200 |
---|---|---|
committer | Laria Carolin Chabowski <laria@laria.me> | 2017-09-26 21:35:40 +0200 |
commit | a845956238e6a41479a7abd59f5c39e71f3f85f4 (patch) | |
tree | c611d5bebf7659e0d52bae4d3693957856eb1014 /main.go | |
parent | 9f8ced40c574054de052849c43f69b66e1e91640 (diff) | |
download | petrific-a845956238e6a41479a7abd59f5c39e71f3f85f4.tar.gz petrific-a845956238e6a41479a7abd59f5c39e71f3f85f4.tar.bz2 petrific-a845956238e6a41479a7abd59f5c39e71f3f85f4.zip |
Implement write-dir
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -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") |