From 6705423dcee0c47da23964cfe22a90e3de4e624a Mon Sep 17 00:00:00 2001 From: Chris Goodwin <40746380+CGoodwin90@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:00:05 +1100 Subject: [PATCH] Fixes & updates output for listProjectGroups (#306) --- cmd/list.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/cmd/list.go b/cmd/list.go index 480e6aba..3df7a7e3 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -594,10 +594,8 @@ var listProjectGroupsCmd = &cobra.Command{ if err != nil { return err } - if cmdProjectName == "" { - fmt.Println("Missing arguments: Project is not defined") - cmd.Help() - os.Exit(1) + if err := requiredInputCheck("Project name", cmdProjectName); err != nil { + return err } current := lagoonCLIConfig.Current @@ -611,8 +609,7 @@ var listProjectGroupsCmd = &cobra.Command{ handleError(err) if len(projectGroups.Groups) == 0 { - output.RenderInfo(fmt.Sprintf("There are no projects in group '%s'", groupName), outputOptions) - os.Exit(0) + outputOptions.Error = fmt.Sprintf("There are no groups for project '%s'\n", cmdProjectName) } data := []output.Data{}