enforce argument to `tea ms issues` (#297)

enforce argument to `tea ms issues`

enforce two arguments

CI.restart()

CI.restart()

CI.restart()

CI.restart()

Co-authored-by: Norwin Roosen <git@nroo.de>
Co-authored-by: 6543 <6543@obermui.de>
Reviewed-on: https://gitea.com/gitea/tea/pulls/297
Reviewed-by: khmarbaise <khmarbaise@noreply.gitea.io>
Reviewed-by: 6543 <6543@obermui.de>
Co-Authored-By: Norwin <noerw@noreply.gitea.io>
Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
Norwin 2020-12-14 20:04:59 +08:00 committed by Lunny Xiao
parent 5a41c79d7d
commit b10d792687
1 changed files with 5 additions and 3 deletions

View File

@ -85,7 +85,9 @@ func runMilestoneIssueList(ctx *cli.Context) error {
kind = gitea.IssueTypePull
}
fmt.Println(state)
if ctx.Args().Len() != 1 {
return fmt.Errorf("Must specify milestone name")
}
milestone := ctx.Args().First()
// make sure milestone exist
@ -111,7 +113,7 @@ func runMilestoneIssueList(ctx *cli.Context) error {
func runMilestoneIssueAdd(ctx *cli.Context) error {
login, owner, repo := config.InitCommand(flags.GlobalRepoValue, flags.GlobalLoginValue, flags.GlobalRemoteValue)
client := login.Client()
if ctx.Args().Len() == 0 {
if ctx.Args().Len() != 2 {
return fmt.Errorf("need two arguments")
}
@ -137,7 +139,7 @@ func runMilestoneIssueAdd(ctx *cli.Context) error {
func runMilestoneIssueRemove(ctx *cli.Context) error {
login, owner, repo := config.InitCommand(flags.GlobalRepoValue, flags.GlobalLoginValue, flags.GlobalRemoteValue)
client := login.Client()
if ctx.Args().Len() == 0 {
if ctx.Args().Len() != 2 {
return fmt.Errorf("need two arguments")
}