(cmd *cobra.Command, args []string)
| 252 | } |
| 253 | |
| 254 | func (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 |
nothing calls this directly
no test coverage detected