From 6292a3a2bd8e7bc3133cd9ca45f06a479081eced Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Thu, 25 Jan 2018 10:20:30 -0600 Subject: [PATCH] Add help --- cmd/gime-export/main.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cmd/gime-export/main.go b/cmd/gime-export/main.go index a0c6010..a93f46b 100644 --- a/cmd/gime-export/main.go +++ b/cmd/gime-export/main.go @@ -52,6 +52,20 @@ func loadRecentTimeEntries() { timeEntries = gdb.LoadTimeEntryCollection(gime.TypeRecent) } +func cmdPrintHelp(args []string) int { + //if len(args) == 0 { + fmt.Println("gime-export - An export utility for the gime application\n") + fmt.Println("Usage: gime-export [format] [[start date/time]-[end date/time]] [tags...]") + for _, v := range validOperations { + for vi := range v { + fmt.Println(" ", v[vi]) + } + fmt.Println("") + } + //} + return 0 +} + func cmdPrintFHGTimesheet(args []string) int { loadRecentTimeEntries() @@ -148,6 +162,11 @@ func initialize() { validOperations = make(map[string][]string) opFuncs = make(map[string]func([]string) int) + opFuncs["help"] = cmdPrintHelp + validOperations["help"] = []string{ + "help - Prints this", + } + opFuncs["fhgts"] = cmdPrintFHGTimesheet validOperations["fhgts"] = []string{ "fhgts [duration] [tags] - Output entries in Flint Hills Group timesheet format",