From 616127cedce19a54d0f41528884aed0f05d46895 Mon Sep 17 00:00:00 2001 From: Norwin Date: Tue, 22 Jun 2021 22:23:09 +0800 Subject: [PATCH] Add missing flags (#369) fixes #368 Co-authored-by: Norwin Roosen Co-authored-by: Lunny Xiao Reviewed-on: https://gitea.com/gitea/tea/pulls/369 Reviewed-by: Andrew Thornton Reviewed-by: Lunny Xiao Co-authored-by: Norwin Co-committed-by: Norwin --- cmd/labels/create.go | 5 +++-- cmd/labels/delete.go | 5 +++-- cmd/labels/update.go | 5 +++-- cmd/organizations/delete.go | 5 +++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/cmd/labels/create.go b/cmd/labels/create.go index c4fcf38..ff850ea 100644 --- a/cmd/labels/create.go +++ b/cmd/labels/create.go @@ -10,6 +10,7 @@ import ( "os" "strings" + "code.gitea.io/tea/cmd/flags" "code.gitea.io/tea/modules/context" "code.gitea.io/sdk/gitea" @@ -23,7 +24,7 @@ var CmdLabelCreate = cli.Command{ Usage: "Create a label", Description: `Create a label`, Action: runLabelCreate, - Flags: []cli.Flag{ + Flags: append([]cli.Flag{ &cli.StringFlag{ Name: "name", Usage: "label name", @@ -40,7 +41,7 @@ var CmdLabelCreate = cli.Command{ Name: "file", Usage: "indicate a label file", }, - }, + }, flags.AllDefaultFlags...), } func runLabelCreate(cmd *cli.Context) error { diff --git a/cmd/labels/delete.go b/cmd/labels/delete.go index cc193a7..7a47b54 100644 --- a/cmd/labels/delete.go +++ b/cmd/labels/delete.go @@ -5,6 +5,7 @@ package labels import ( + "code.gitea.io/tea/cmd/flags" "code.gitea.io/tea/modules/context" "github.com/urfave/cli/v2" @@ -17,12 +18,12 @@ var CmdLabelDelete = cli.Command{ Usage: "Delete a label", Description: `Delete a label`, Action: runLabelDelete, - Flags: []cli.Flag{ + Flags: append([]cli.Flag{ &cli.IntFlag{ Name: "id", Usage: "label id", }, - }, + }, flags.AllDefaultFlags...), } func runLabelDelete(cmd *cli.Context) error { diff --git a/cmd/labels/update.go b/cmd/labels/update.go index f3fb8b6..6b2106f 100644 --- a/cmd/labels/update.go +++ b/cmd/labels/update.go @@ -5,6 +5,7 @@ package labels import ( + "code.gitea.io/tea/cmd/flags" "code.gitea.io/tea/modules/context" "code.gitea.io/sdk/gitea" @@ -17,7 +18,7 @@ var CmdLabelUpdate = cli.Command{ Usage: "Update a label", Description: `Update a label`, Action: runLabelUpdate, - Flags: []cli.Flag{ + Flags: append([]cli.Flag{ &cli.IntFlag{ Name: "id", Usage: "label id", @@ -34,7 +35,7 @@ var CmdLabelUpdate = cli.Command{ Name: "description", Usage: "label description", }, - }, + }, flags.AllDefaultFlags...), } func runLabelUpdate(cmd *cli.Context) error { diff --git a/cmd/organizations/delete.go b/cmd/organizations/delete.go index f194530..950a697 100644 --- a/cmd/organizations/delete.go +++ b/cmd/organizations/delete.go @@ -7,6 +7,7 @@ package organizations import ( "fmt" + "code.gitea.io/tea/cmd/flags" "code.gitea.io/tea/modules/context" "github.com/urfave/cli/v2" ) @@ -19,6 +20,10 @@ var CmdOrganizationDelete = cli.Command{ Description: "Delete users organizations", ArgsUsage: "", Action: RunOrganizationDelete, + Flags: []cli.Flag{ + &flags.LoginFlag, + &flags.RemoteFlag, + }, } // RunOrganizationDelete delete user organization