Let's actually parse the flags
This commit is contained in:
parent
ee545423c8
commit
8035fbbf17
11
main.go
11
main.go
@ -67,7 +67,9 @@ func logTextStatus(logFile *os.File, timerConfig TimerConfig, status string, don
|
|||||||
Done: done,
|
Done: done,
|
||||||
})
|
})
|
||||||
if err == nil {
|
if err == nil {
|
||||||
logFile.WriteString(jstring + "\n")
|
if logFile != nil {
|
||||||
|
logFile.WriteString(jstring + "\n")
|
||||||
|
}
|
||||||
fmt.Printf("%s / %s\n", status, timerConfig.Duration.String())
|
fmt.Printf("%s / %s\n", status, timerConfig.Duration.String())
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -90,8 +92,11 @@ func main() {
|
|||||||
flag.DurationVar(&duration, "duration", 25*time.Minute, "Gomodoro duration")
|
flag.DurationVar(&duration, "duration", 25*time.Minute, "Gomodoro duration")
|
||||||
var interval time.Duration
|
var interval time.Duration
|
||||||
flag.DurationVar(&interval, "interval", 1*time.Second, "Gomodoro tick interval")
|
flag.DurationVar(&interval, "interval", 1*time.Second, "Gomodoro tick interval")
|
||||||
var status bool
|
/* Haven't found a good way to tail a file in golang yet
|
||||||
flag.BoolVar(&status, "status", false, "Only display current Gomodoro status")
|
* var status bool
|
||||||
|
* flag.BoolVar(&status, "status", false, "Only display current Gomodoro status")
|
||||||
|
*/
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
// Ensure obtain lock
|
// Ensure obtain lock
|
||||||
lock, err := tryLock()
|
lock, err := tryLock()
|
||||||
|
Loading…
Reference in New Issue
Block a user