Add help argument
parent
52f01a4bdc
commit
ea94384a7c
16
main.go
16
main.go
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue