diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -33,6 +33,16 @@ func main() { }, Action: func(ctx context.Context, cmd *cli.Command) error { taskIndex := cmd.IntArg("taskIndex") + + // If taskIndex is 0, it's + // likely missing; any other + // non-positive value is a + // deliberate + // misconfiguration. + if taskIndex <= 0 { + return fmt.Errorf("invalid 'do' argument: %d", taskIndex) + } + fmt.Println("completed task: ", taskIndex) return nil }, |
