summaryrefslogtreecommitdiff
path: root/cmds.go
diff options
context:
space:
mode:
authordemo <demo@antix1>2026-05-29 10:24:27 -0400
committerdemo <demo@antix1>2026-05-29 10:24:27 -0400
commit5fdc04709975732733bf0ddc1308ea25c0cb453a (patch)
tree33f436a58139ed1e36a96af7398d417b488f2186 /cmds.go
parent5b03eac7cb9e7b5c736e217d8a63b4ac14af28be (diff)
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.
Diffstat (limited to 'cmds.go')
-rw-r--r--cmds.go20
1 files changed, 20 insertions, 0 deletions
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
+}