From c62ce458e8101e38fb7fd7eb5a17b5e22a10eb40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wojciech=20Ma=C5=82ota-W=C3=B3jcik?= <59281144+outofforest@users.noreply.github.com> Date: Wed, 14 Aug 2024 09:49:26 +0200 Subject: [PATCH] Fix example (#84) --- example/main.go | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/example/main.go b/example/main.go index 3ede1d7..5b19c1d 100644 --- a/example/main.go +++ b/example/main.go @@ -17,16 +17,15 @@ import ( // go run . bCmd // go run . cCmd -var commands = map[string]build.Command{ - "aCmd": {Fn: commandA, Description: "This is commandA"}, - "aCmd/aaCmd": {Fn: commandAA, Description: "This is commandAA"}, - "aCmd/abCmd": {Fn: commandAB, Description: "This is commandAB"}, - "bCmd": {Fn: commandB, Description: "This is commandB"}, - "cCmd": {Fn: commandC, Description: "This is commandC"}, -} - func main() { - build.Main("env-name", commands) + build.RegisterCommands(map[string]build.Command{ + "aCmd": {Fn: commandA, Description: "This is commandA"}, + "aCmd/aaCmd": {Fn: commandAA, Description: "This is commandAA"}, + "aCmd/abCmd": {Fn: commandAB, Description: "This is commandAB"}, + "bCmd": {Fn: commandB, Description: "This is commandB"}, + "cCmd": {Fn: commandC, Description: "This is commandC"}, + }) + build.Main("env-name") } func commandA(ctx context.Context, deps build.DepsFunc) error {