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:
cpamayo
2026-05-07 00:14:22 +00:00
committed by Lunny Xiao
parent a5ecf06c2a
commit f617f26da0
2 changed files with 7 additions and 7 deletions

View File

@@ -4,14 +4,14 @@
package organizations
import (
"fmt"
stdctx "context"
"fmt"
"code.gitea.io/sdk/gitea"
"code.gitea.io/tea/cmd/flags"
"code.gitea.io/tea/modules/context"
"code.gitea.io/tea/modules/print"
"github.com/urfave/cli/v3"
)
@@ -25,7 +25,7 @@ var CmdOrganizationCreate = cli.Command{
ArgsUsage: "<organization name>",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "name",
Name: "full-name",
Aliases: []string{"n"},
},
&cli.StringFlag{
@@ -75,8 +75,8 @@ func RunOrganizationCreate(_ stdctx.Context, cmd *cli.Command) error {
}
org, _, err := ctx.Login.Client().CreateOrg(gitea.CreateOrgOption{
Name: ctx.Args().First(),
// FullName: , // not really meaningful for orgs (not displayed in webui, use description instead?)
Name: ctx.Args().First(),
FullName: ctx.String("full-name"),
Description: ctx.String("description"),
Website: ctx.String("website"),
Location: ctx.String("location"),