From 625c2ce7a713c3740545e7bfcbd91d0371389a01 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Mon, 29 Jan 2024 08:42:38 -0500 Subject: [PATCH] fix: update code to match new cli-skeleton arguments --- main.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 404b59e..4e309ee 100644 --- a/main.go +++ b/main.go @@ -1,6 +1,7 @@ package main import ( + "context" "fmt" "netrc/commands" "os" @@ -19,10 +20,11 @@ func main() { // Executes the specified command func Run(args []string) int { - commandMeta := command.SetupRun(AppName, Version, args) + ctx := context.Background() + commandMeta := command.SetupRun(ctx, AppName, Version, args) c := cli.NewCLI(AppName, Version) c.Args = os.Args[1:] - c.Commands = command.Commands(commandMeta, Commands) + c.Commands = command.Commands(ctx, commandMeta, Commands) exitCode, err := c.Run() if err != nil { fmt.Fprintf(os.Stderr, "Error executing CLI: %s\n", err.Error()) @@ -33,7 +35,7 @@ func Run(args []string) int { } // Returns a list of implemented commands -func Commands(meta command.Meta) map[string]cli.CommandFactory { +func Commands(ctx context.Context, meta command.Meta) map[string]cli.CommandFactory { return map[string]cli.CommandFactory{ "set": func() (cli.Command, error) { return &commands.SetCommand{Meta: meta}, nil