()
| 134 | category := strings.TrimSpace(c.category) |
| 135 | if cmd.Flags().Changed("category") && category == "" { |
| 136 | return apierr.ErrUsage("--category needs a title; a blank one does not clear a category") |
| 137 | } |
| 138 | |
| 139 | if err = sdk.TimeTracks().StopAndFile(ctx, track.Id, category); err != nil { |
| 140 | return apierr.FromSDK(err) |
| 141 | } |
| 142 | |
| 143 | summary := "Time tracking stopped" |
| 144 | if category != "" { |
| 145 | summary = fmt.Sprintf("Time tracking stopped and filed under %q", category) |
| 146 | } |
| 147 | return writeMutation(cmd, summary, nil) |
| 148 | } |
| 149 | |
| 150 | // current |
no outgoing calls
no test coverage detected