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

Method run

internal/cmd/todo.go:301–323  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

299}
300
301func (c *todoDeleteCommand) run(cmd *cobra.Command, args []string) error {
302 if err := requireAuth(); err != nil {
303 return err
304 }
305
306 id, err := strconv.ParseInt(args[0], 10, 64)
307 if err != nil {
308 return output.ErrUsage(fmt.Sprintf("invalid todo ID: %s", args[0]))
309 }
310
311 ctx := cmd.Context()
312 err = sdk.CalendarTodos().Delete(ctx, id)
313 if err != nil {
314 return convertSDKError(err)
315 }
316
317 if writer.IsStyled() {
318 fmt.Fprintln(cmd.OutOrStdout(), "Todo deleted.")
319 return nil
320 }
321
322 return writeOK(nil, output.WithSummary("Todo deleted"))
323}

Callers

nothing calls this directly

Calls 6

WithSummaryFunction · 0.92
requireAuthFunction · 0.85
convertSDKErrorFunction · 0.85
writeOKFunction · 0.85
DeleteMethod · 0.80
IsStyledMethod · 0.80

Tested by

no test coverage detected