mirror of
https://gitea.com/gitea/tea.git
synced 2026-05-15 20:29:22 +02:00
fix: pass the name flag value as the organization FullName (#832)
This change proposes that, when creating an organization using the CLI, the value provided in the `--name` parameter is used as the organization `FullName`. --------- Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-on: https://gitea.com/gitea/tea/pulls/832 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: cpamayo <anderson.carl3@mayo.edu> Co-committed-by: cpamayo <anderson.carl3@mayo.edu>
This commit is contained in:
@@ -4,14 +4,14 @@
|
|||||||
package organizations
|
package organizations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
|
|
||||||
stdctx "context"
|
stdctx "context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
"code.gitea.io/tea/cmd/flags"
|
"code.gitea.io/tea/cmd/flags"
|
||||||
"code.gitea.io/tea/modules/context"
|
"code.gitea.io/tea/modules/context"
|
||||||
"code.gitea.io/tea/modules/print"
|
"code.gitea.io/tea/modules/print"
|
||||||
|
|
||||||
"github.com/urfave/cli/v3"
|
"github.com/urfave/cli/v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -25,7 +25,7 @@ var CmdOrganizationCreate = cli.Command{
|
|||||||
ArgsUsage: "<organization name>",
|
ArgsUsage: "<organization name>",
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "name",
|
Name: "full-name",
|
||||||
Aliases: []string{"n"},
|
Aliases: []string{"n"},
|
||||||
},
|
},
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
@@ -76,7 +76,7 @@ func RunOrganizationCreate(_ stdctx.Context, cmd *cli.Command) error {
|
|||||||
|
|
||||||
org, _, err := ctx.Login.Client().CreateOrg(gitea.CreateOrgOption{
|
org, _, err := ctx.Login.Client().CreateOrg(gitea.CreateOrgOption{
|
||||||
Name: ctx.Args().First(),
|
Name: ctx.Args().First(),
|
||||||
// FullName: , // not really meaningful for orgs (not displayed in webui, use description instead?)
|
FullName: ctx.String("full-name"),
|
||||||
Description: ctx.String("description"),
|
Description: ctx.String("description"),
|
||||||
Website: ctx.String("website"),
|
Website: ctx.String("website"),
|
||||||
Location: ctx.String("location"),
|
Location: ctx.String("location"),
|
||||||
|
|||||||
@@ -1043,12 +1043,12 @@ Create an organization
|
|||||||
|
|
||||||
**--description, -d**="":
|
**--description, -d**="":
|
||||||
|
|
||||||
|
**--full-name, -n**="":
|
||||||
|
|
||||||
**--location, -L**="":
|
**--location, -L**="":
|
||||||
|
|
||||||
**--login, -l**="": Use a different Gitea Login. Optional
|
**--login, -l**="": Use a different Gitea Login. Optional
|
||||||
|
|
||||||
**--name, -n**="":
|
|
||||||
|
|
||||||
**--repo-admins-can-change-team-access**:
|
**--repo-admins-can-change-team-access**:
|
||||||
|
|
||||||
**--visibility, -v**="":
|
**--visibility, -v**="":
|
||||||
|
|||||||
Reference in New Issue
Block a user