Skip to content

Commit

Permalink
Updated error messaging to highlight subcommands & generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
CGoodwin90 committed Mar 14, 2024
1 parent 9d99de0 commit 6e64f6e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 9 deletions.
3 changes: 2 additions & 1 deletion cmd/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"context"
"fmt"

"github.com/spf13/cobra"
"github.com/uselagoon/lagoon-cli/pkg/output"
Expand Down Expand Up @@ -44,7 +45,7 @@ var addOrganizationCmd = &cobra.Command{
return err
}
if err := requiredInputCheck("Organization name", organizationName); err != nil {
return err
return fmt.Errorf("%v | Additional subcommands for deploytarget, group, project & user are available. --help for more information", err)
}
organizationFriendlyName, err := cmd.Flags().GetString("friendly-name")
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/lagoon_add.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Add a project, or add notifications and variables to projects or environments
* [lagoon add deploytarget-config](lagoon_add_deploytarget-config.md) - Add deploytarget config to a project
* [lagoon add group](lagoon_add_group.md) - Add a group to lagoon
* [lagoon add notification](lagoon_add_notification.md) - Add notifications or add notifications to projects
* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a group/project to an organization
* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a deploytarget/group/project/user to an organization
* [lagoon add project](lagoon_add_project.md) - Add a new project to Lagoon
* [lagoon add project-group](lagoon_add_project-group.md) - Add a project to a group in lagoon
* [lagoon add user](lagoon_add_user.md) - Add a user to lagoon
Expand Down
17 changes: 14 additions & 3 deletions docs/commands/lagoon_add_organization.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
## lagoon add organization

Add an organization, or add a group/project to an organization
Add an organization, or add a deploytarget/group/project/user to an organization

```
lagoon add organization [flags]
```

### Options

```
-h, --help help for organization
--description string Description of the organization
--environment-quota int Environment quota for the organization
--friendly-name string Friendly name of the organization
--group-quota int Group quota for the organization
-h, --help help for organization
-O, --name string Name of the organization
--notification-quota int Notification quota for the organization
--project-quota int Project quota for the organization
--route-quota int Route quota for the organization
```

### Options inherited from parent commands
Expand All @@ -30,7 +42,6 @@ Add an organization, or add a group/project to an organization
* [lagoon add](lagoon_add.md) - Add a project, or add notifications and variables to projects or environments
* [lagoon add organization deploytarget](lagoon_add_organization_deploytarget.md) - Add a deploy target to an Organization
* [lagoon add organization group](lagoon_add_organization_group.md) - Add a group to an Organization
* [lagoon add organization organization](lagoon_add_organization_organization.md) - Add a new organization to Lagoon
* [lagoon add organization project](lagoon_add_organization_project.md) - Add a project to an Organization
* [lagoon add organization user](lagoon_add_organization_user.md) - Add a user to an Organization

2 changes: 1 addition & 1 deletion docs/commands/lagoon_add_organization_deploytarget.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ lagoon add organization deploytarget [flags]

### SEE ALSO

* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a group/project to an organization
* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a deploytarget/group/project/user to an organization

2 changes: 1 addition & 1 deletion docs/commands/lagoon_add_organization_group.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ lagoon add organization group [flags]

### SEE ALSO

* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a group/project to an organization
* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a deploytarget/group/project/user to an organization

2 changes: 1 addition & 1 deletion docs/commands/lagoon_add_organization_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ lagoon add organization project [flags]

### SEE ALSO

* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a group/project to an organization
* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a deploytarget/group/project/user to an organization

2 changes: 1 addition & 1 deletion docs/commands/lagoon_add_organization_user.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ lagoon add organization user [flags]

### SEE ALSO

* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a group/project to an organization
* [lagoon add organization](lagoon_add_organization.md) - Add an organization, or add a deploytarget/group/project/user to an organization

0 comments on commit 6e64f6e

Please sign in to comment.