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

Function newHabitCompleteCommand

internal/cmd/habit.go:40–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38}
39
40func newHabitCompleteCommand() *habitCompleteCommand {
41 habitCompleteCommand := &habitCompleteCommand{}
42 habitCompleteCommand.cmd = &cobra.Command{
43 Use: "complete <id>",
44 Short: "Mark a habit as complete for a date",
45 Example: ` hey habit complete 789
46 hey habit complete 789 --date 2024-01-15`,
47 RunE: habitCompleteCommand.run,
48 Args: usageExactOneArg(),
49 }
50
51 habitCompleteCommand.cmd.Flags().StringVar(&habitCompleteCommand.date, "date", "", "Date (YYYY-MM-DD, default: today)")
52
53 return habitCompleteCommand
54}
55
56func (c *habitCompleteCommand) run(cmd *cobra.Command, args []string) error {
57 if err := requireAuth(); err != nil {

Callers 1

newHabitCommandFunction · 0.85

Calls 1

usageExactOneArgFunction · 0.85

Tested by

no test coverage detected