Add help argument

main
e1mo 2020-01-16 22:27:59 +01:00
parent 52f01a4bdc
commit ea94384a7c
No known key found for this signature in database
GPG Key ID: B5792B4DD32F65B7
1 changed files with 16 additions and 0 deletions

16
main.go
View File

@ -75,6 +75,18 @@ func list(records []Record) {
}
}
func help() {
fmt.Println("go time tracker v0.1\n")
fmt.Println("Syntax: gott [start|stop|list|help]\n")
fmt.Println("Options:")
fmt.Println("\tstart\t\tStart new time interval")
fmt.Println("\tstop [tag(s)]\tStop current time tracking interval")
fmt.Println("\tlist\t\tList all entries")
fmt.Println("\thelp, h\t show this help")
fmt.Println("\nThis Software is freely developed at\nhttps://git.soundship.de/gcrkrause/gott unter the MIT License")
fmt.Println("Copyright © 2020 Georg Krause <mail@georg-krause.net>\nSee LICENSE for the full license")
}
func main() {
datafile := os.Getenv("HOME") + "/.gott/data.json"
@ -117,6 +129,10 @@ func main() {
stop(current, args[1:])
case "list":
list(data.Entries)
case "help":
help()
case "h":
help()
default:
fmt.Println("Unknown argument")
}