From 5fdc04709975732733bf0ddc1308ea25c0cb453a Mon Sep 17 00:00:00 2001 From: demo Date: Fri, 29 May 2026 10:24:27 -0400 Subject: refactor: funnel business logic into bespoke functions This way: 1. We don't have to stuff all our business logic where urfave is set up. 2. Our functions aren't forced to use the signature required by the Action field. --- cmds.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 cmds.go (limited to 'cmds.go') diff --git a/cmds.go b/cmds.go new file mode 100644 index 0000000..26cded5 --- /dev/null +++ b/cmds.go @@ -0,0 +1,20 @@ +package main + +import ( + "fmt" +) + +func cmdAdd(task string) error { + fmt.Println("added task: ", task) + return nil +} + +func cmdDo(taskIndex int) error { + fmt.Println("completed task: ", taskIndex) + return nil +} + +func cmdList() error { + fmt.Println("listed pending tasks") + return nil +} -- cgit v1.2.3