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

Method run

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

Source from the content-addressed store, hash-verified

252}
253
254func (c *todoUncompleteCommand) run(cmd *cobra.Command, args []string) error {
255 if err := requireAuth(); err != nil {
256 return err
257 }
258
259 id, err := strconv.ParseInt(args[0], 10, 64)
260 if err != nil {
261 return output.ErrUsage(fmt.Sprintf("invalid todo ID: %s", args[0]))
262 }
263
264 ctx := cmd.Context()
265 result, err := sdk.CalendarTodos().Uncomplete(ctx, id)
266 if err != nil {
267 return convertSDKError(err)
268 }
269
270 if writer.IsStyled() {
271 fmt.Fprintf(cmd.OutOrStdout(), "Todo marked incomplete.%s\n", extractMutationInfoFromResult(result))
272 return nil
273 }
274
275 normalized, nerr := normalizeAny(result)
276 if nerr != nil {
277 return writeOK(nil, output.WithSummary("Todo marked incomplete"))
278 }
279 return writeOK(normalized, output.WithSummary("Todo marked incomplete"))
280}
281
282// delete
283

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected