File: close.go

package info (click to toggle)
tea-cli 0.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,648 kB
  • sloc: makefile: 116; sh: 17
file content (26 lines) | stat: -rw-r--r-- 712 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2020 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT

package pulls

import (
	"context"

	"code.gitea.io/tea/cmd/flags"

	"code.gitea.io/sdk/gitea"
	"github.com/urfave/cli/v3"
)

// CmdPullsClose closes a given open pull request
var CmdPullsClose = cli.Command{
	Name:        "close",
	Usage:       "Change state of one or more pull requests to 'closed'",
	Description: `Change state of one or more pull requests to 'closed'`,
	ArgsUsage:   "<pull index> [<pull index>...]",
	Action: func(ctx context.Context, cmd *cli.Command) error {
		var s = gitea.StateClosed
		return editPullState(ctx, cmd, gitea.EditPullRequestOption{State: &s})
	},
	Flags: flags.AllDefaultFlags,
}