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

Function newTodoAddCommand

internal/cmd/todo.go:127–144  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125}
126
127func newTodoAddCommand() *todoAddCommand {
128 todoAddCommand := &todoAddCommand{}
129 todoAddCommand.cmd = &cobra.Command{
130 Use: "add [title]",
131 Short: "Create a new todo",
132 Example: ` hey todo add "Buy groceries"
133 hey todo add -t "Meeting prep" --date 2024-01-20
134 hey todo add --title "Review PR" --json
135 echo "Buy milk" | hey todo add`,
136 RunE: todoAddCommand.run,
137 Args: cobra.MaximumNArgs(1),
138 }
139
140 todoAddCommand.cmd.Flags().StringVarP(&todoAddCommand.title, "title", "t", "", "Todo title")
141 todoAddCommand.cmd.Flags().StringVar(&todoAddCommand.date, "date", "", "Due date (YYYY-MM-DD)")
142
143 return todoAddCommand
144}
145
146func (c *todoAddCommand) run(cmd *cobra.Command, args []string) error {
147 if err := requireAuth(); err != nil {

Callers 1

newTodoCommandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected