Skip to content

Commit

Permalink
Fixes & updates output for listProjectGroups (#306)
Browse files Browse the repository at this point in the history
  • Loading branch information
CGoodwin90 committed Dec 6, 2023
1 parent 8057826 commit 6705423
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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{}
Expand Down

0 comments on commit 6705423

Please sign in to comment.