(cmd *cobra.Command, args []string)
| 78 | } |
| 79 | |
| 80 | func (c *unseenCommand) run(cmd *cobra.Command, args []string) error { |
| 81 | if err := requireAuth(); err != nil { |
| 82 | return err |
| 83 | } |
| 84 | |
| 85 | ids, err := parseIntArgs(args) |
| 86 | if err != nil { |
| 87 | return err |
| 88 | } |
| 89 | |
| 90 | if err := sdk.Postings().MarkUnseen(cmd.Context(), ids); err != nil { |
| 91 | return convertSDKError(err) |
| 92 | } |
| 93 | |
| 94 | summary := fmt.Sprintf("%d posting(s) marked as unseen", len(ids)) |
| 95 | |
| 96 | if writer.IsStyled() { |
| 97 | fmt.Fprintln(cmd.OutOrStdout(), summary+".") |
| 98 | return nil |
| 99 | } |
| 100 | |
| 101 | return writeOK(nil, output.WithSummary(summary)) |
| 102 | } |
| 103 | |
| 104 | func parseIntArgs(args []string) ([]int64, error) { |
| 105 | ids := make([]int64, 0, len(args)) |
nothing calls this directly
no test coverage detected