Skip to content

Commit

Permalink
fix(timer start): pass note flag to timer req func
Browse files Browse the repository at this point in the history
  • Loading branch information
hdahlheim committed Jan 4, 2022
1 parent 6c850c0 commit 7e3c1d1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ hakuna timer start --taskId=2 --note="Building cool stuff!"
```

If you don't want to use environment variables you can use the `.hakuna.yaml` config file.
The CLI searches for the config file in two places, the first in the current directory and
The CLI searches for the config file in two places, first in the current directory and
after that in the user home directory.

Example using the config file:
Expand Down
2 changes: 1 addition & 1 deletion cmd/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// tasksCmd represents the tasks command
var tasksCmd = &cobra.Command{
Use: "tasks",
Short: "List all task",
Short: "List all tasks",
RunE: func(cmd *cobra.Command, args []string) error {
format, err := cmd.LocalFlags().GetString("format")
if err != nil {
Expand Down
7 changes: 6 additions & 1 deletion cmd/timer.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,14 @@ func startTimer(cmd *cobra.Command, args []string) error {
startTime = pTime
}

noteFlag, err := cmd.LocalFlags().GetString("note")
if err != nil {
return err
}

h := initHakunaClient()

req, err := hakuna.NewStartTimerReq(taskId, startTime, "", 0)
req, err := hakuna.NewStartTimerReq(taskId, startTime, noteFlag, 0)
if err != nil {
return err
}
Expand Down

0 comments on commit 7e3c1d1

Please sign in to comment.