MCPcopy Create free account
hub / github.com/basecamp/hey-cli / newTimetrackCurrentCommand

Function newTimetrackCurrentCommand

internal/cmd/timetrack.go:136–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 1

newTimetrackCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected