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

Method run

internal/cmd/timetrack.go:54–82  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

52}
53
54func (c *timetrackStartCommand) run(cmd *cobra.Command, args []string) error {
55 if err := requireAuth(); err != nil {
56 return err
57 }
58
59 ctx := cmd.Context()
60 result, err := sdk.TimeTracks().Start(ctx, generated.StartTimeTrackJSONRequestBody{})
61 if err != nil {
62 return convertSDKError(err)
63 }
64
65 if writer.IsStyled() {
66 fmt.Fprintln(cmd.OutOrStdout(), "Time tracking started.")
67 return nil
68 }
69
70 normalized, nerr := normalizeAny(result)
71 if nerr != nil {
72 return writeOK(nil, output.WithSummary("Time tracking started"))
73 }
74 return writeOK(normalized,
75 output.WithSummary("Time tracking started"),
76 output.WithBreadcrumbs(output.Breadcrumb{
77 Action: "stop",
78 Command: "hey timetrack stop",
79 Description: "Stop time tracking",
80 }),
81 )
82}
83
84// stop
85

Callers

nothing calls this directly

Calls 7

WithSummaryFunction · 0.92
WithBreadcrumbsFunction · 0.92
requireAuthFunction · 0.85
convertSDKErrorFunction · 0.85
normalizeAnyFunction · 0.85
writeOKFunction · 0.85
IsStyledMethod · 0.80

Tested by

no test coverage detected