summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/main.go b/main.go
index 7838fcb..81d916a 100644
--- a/main.go
+++ b/main.go
@@ -108,6 +108,24 @@ func main() {
return ctrl.cmdList()
},
},
+ {
+ Name: "rm",
+ Usage: "delete a task permanently",
+ Arguments: []cli.Argument{
+ &cli.IntArg{
+ Name: "taskIndex",
+ },
+ },
+ Action: func(ctx context.Context, cmd *cli.Command) error {
+ taskIndex := cmd.IntArg("taskIndex")
+
+ if taskIndex <= 0 {
+ return fmt.Errorf("invalid 'undo' argument: %d", taskIndex)
+ }
+
+ return ctrl.cmdRm(taskIndex)
+ },
+ },
},
}