mirror of
https://gitea.com/gitea/tea.git
synced 2024-12-04 16:25:10 +01:00
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:
parent
5a41c79d7d
commit
b10d792687
@ -85,7 +85,9 @@ func runMilestoneIssueList(ctx *cli.Context) error {
|
|||||||
kind = gitea.IssueTypePull
|
kind = gitea.IssueTypePull
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println(state)
|
if ctx.Args().Len() != 1 {
|
||||||
|
return fmt.Errorf("Must specify milestone name")
|
||||||
|
}
|
||||||
|
|
||||||
milestone := ctx.Args().First()
|
milestone := ctx.Args().First()
|
||||||
// make sure milestone exist
|
// make sure milestone exist
|
||||||
@ -111,7 +113,7 @@ func runMilestoneIssueList(ctx *cli.Context) error {
|
|||||||
func runMilestoneIssueAdd(ctx *cli.Context) error {
|
func runMilestoneIssueAdd(ctx *cli.Context) error {
|
||||||
login, owner, repo := config.InitCommand(flags.GlobalRepoValue, flags.GlobalLoginValue, flags.GlobalRemoteValue)
|
login, owner, repo := config.InitCommand(flags.GlobalRepoValue, flags.GlobalLoginValue, flags.GlobalRemoteValue)
|
||||||
client := login.Client()
|
client := login.Client()
|
||||||
if ctx.Args().Len() == 0 {
|
if ctx.Args().Len() != 2 {
|
||||||
return fmt.Errorf("need two arguments")
|
return fmt.Errorf("need two arguments")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +139,7 @@ func runMilestoneIssueAdd(ctx *cli.Context) error {
|
|||||||
func runMilestoneIssueRemove(ctx *cli.Context) error {
|
func runMilestoneIssueRemove(ctx *cli.Context) error {
|
||||||
login, owner, repo := config.InitCommand(flags.GlobalRepoValue, flags.GlobalLoginValue, flags.GlobalRemoteValue)
|
login, owner, repo := config.InitCommand(flags.GlobalRepoValue, flags.GlobalLoginValue, flags.GlobalRemoteValue)
|
||||||
client := login.Client()
|
client := login.Client()
|
||||||
if ctx.Args().Len() == 0 {
|
if ctx.Args().Len() != 2 {
|
||||||
return fmt.Errorf("need two arguments")
|
return fmt.Errorf("need two arguments")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user