mirror of
https://gitea.com/gitea/tea.git
synced 2024-11-22 02:21:36 +01:00
Add missing flags (#369)
fixes #368 Co-authored-by: Norwin Roosen <git@nroo.de> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-on: https://gitea.com/gitea/tea/pulls/369 Reviewed-by: Andrew Thornton <art27@cantab.net> Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: Norwin <noerw@noreply.gitea.io> Co-committed-by: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
parent
3129e60a73
commit
616127cedc
@ -10,6 +10,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"code.gitea.io/tea/cmd/flags"
|
||||||
"code.gitea.io/tea/modules/context"
|
"code.gitea.io/tea/modules/context"
|
||||||
|
|
||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
@ -23,7 +24,7 @@ var CmdLabelCreate = cli.Command{
|
|||||||
Usage: "Create a label",
|
Usage: "Create a label",
|
||||||
Description: `Create a label`,
|
Description: `Create a label`,
|
||||||
Action: runLabelCreate,
|
Action: runLabelCreate,
|
||||||
Flags: []cli.Flag{
|
Flags: append([]cli.Flag{
|
||||||
&cli.StringFlag{
|
&cli.StringFlag{
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Usage: "label name",
|
Usage: "label name",
|
||||||
@ -40,7 +41,7 @@ var CmdLabelCreate = cli.Command{
|
|||||||
Name: "file",
|
Name: "file",
|
||||||
Usage: "indicate a label file",
|
Usage: "indicate a label file",
|
||||||
},
|
},
|
||||||
},
|
}, flags.AllDefaultFlags...),
|
||||||
}
|
}
|
||||||
|
|
||||||
func runLabelCreate(cmd *cli.Context) error {
|
func runLabelCreate(cmd *cli.Context) error {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
package labels
|
package labels
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"code.gitea.io/tea/cmd/flags"
|
||||||
"code.gitea.io/tea/modules/context"
|
"code.gitea.io/tea/modules/context"
|
||||||
|
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
@ -17,12 +18,12 @@ var CmdLabelDelete = cli.Command{
|
|||||||
Usage: "Delete a label",
|
Usage: "Delete a label",
|
||||||
Description: `Delete a label`,
|
Description: `Delete a label`,
|
||||||
Action: runLabelDelete,
|
Action: runLabelDelete,
|
||||||
Flags: []cli.Flag{
|
Flags: append([]cli.Flag{
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "id",
|
Name: "id",
|
||||||
Usage: "label id",
|
Usage: "label id",
|
||||||
},
|
},
|
||||||
},
|
}, flags.AllDefaultFlags...),
|
||||||
}
|
}
|
||||||
|
|
||||||
func runLabelDelete(cmd *cli.Context) error {
|
func runLabelDelete(cmd *cli.Context) error {
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
package labels
|
package labels
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"code.gitea.io/tea/cmd/flags"
|
||||||
"code.gitea.io/tea/modules/context"
|
"code.gitea.io/tea/modules/context"
|
||||||
|
|
||||||
"code.gitea.io/sdk/gitea"
|
"code.gitea.io/sdk/gitea"
|
||||||
@ -17,7 +18,7 @@ var CmdLabelUpdate = cli.Command{
|
|||||||
Usage: "Update a label",
|
Usage: "Update a label",
|
||||||
Description: `Update a label`,
|
Description: `Update a label`,
|
||||||
Action: runLabelUpdate,
|
Action: runLabelUpdate,
|
||||||
Flags: []cli.Flag{
|
Flags: append([]cli.Flag{
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "id",
|
Name: "id",
|
||||||
Usage: "label id",
|
Usage: "label id",
|
||||||
@ -34,7 +35,7 @@ var CmdLabelUpdate = cli.Command{
|
|||||||
Name: "description",
|
Name: "description",
|
||||||
Usage: "label description",
|
Usage: "label description",
|
||||||
},
|
},
|
||||||
},
|
}, flags.AllDefaultFlags...),
|
||||||
}
|
}
|
||||||
|
|
||||||
func runLabelUpdate(cmd *cli.Context) error {
|
func runLabelUpdate(cmd *cli.Context) error {
|
||||||
|
@ -7,6 +7,7 @@ package organizations
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
"code.gitea.io/tea/cmd/flags"
|
||||||
"code.gitea.io/tea/modules/context"
|
"code.gitea.io/tea/modules/context"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
@ -19,6 +20,10 @@ var CmdOrganizationDelete = cli.Command{
|
|||||||
Description: "Delete users organizations",
|
Description: "Delete users organizations",
|
||||||
ArgsUsage: "<organization name>",
|
ArgsUsage: "<organization name>",
|
||||||
Action: RunOrganizationDelete,
|
Action: RunOrganizationDelete,
|
||||||
|
Flags: []cli.Flag{
|
||||||
|
&flags.LoginFlag,
|
||||||
|
&flags.RemoteFlag,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// RunOrganizationDelete delete user organization
|
// RunOrganizationDelete delete user organization
|
||||||
|
Loading…
Reference in New Issue
Block a user