2019-10-19 06:54:16 -04:00
|
|
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"log"
|
|
|
|
|
2020-09-30 01:11:33 -04:00
|
|
|
"code.gitea.io/tea/cmd/labels"
|
2020-01-04 12:44:25 -05:00
|
|
|
"github.com/urfave/cli/v2"
|
2019-10-19 06:54:16 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
// CmdLabels represents to operate repositories' labels.
|
|
|
|
var CmdLabels = cli.Command{
|
|
|
|
Name: "labels",
|
2020-10-02 11:46:51 -04:00
|
|
|
Aliases: []string{"label"},
|
2019-11-03 15:34:41 -05:00
|
|
|
Usage: "Manage issue labels",
|
|
|
|
Description: `Manage issue labels`,
|
2019-10-19 06:54:16 -04:00
|
|
|
Action: runLabels,
|
2020-01-04 12:44:25 -05:00
|
|
|
Subcommands: []*cli.Command{
|
2020-12-08 14:06:15 -05:00
|
|
|
&labels.CmdLabelsList,
|
2020-09-30 01:11:33 -04:00
|
|
|
&labels.CmdLabelCreate,
|
|
|
|
&labels.CmdLabelUpdate,
|
|
|
|
&labels.CmdLabelDelete,
|
2019-10-19 06:54:16 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
func runLabels(ctx *cli.Context) error {
|
2020-12-08 14:06:15 -05:00
|
|
|
if ctx.Args().Len() == 1 {
|
|
|
|
return runLabelsDetails(ctx)
|
2019-10-19 06:54:16 -04:00
|
|
|
}
|
2020-12-08 14:06:15 -05:00
|
|
|
return labels.RunLabelsList(ctx)
|
|
|
|
}
|
2019-10-19 06:54:16 -04:00
|
|
|
|
2020-12-08 14:06:15 -05:00
|
|
|
func runLabelsDetails(ctx *cli.Context) error {
|
|
|
|
log.Fatal("Not yet implemented.")
|
2019-10-19 06:54:16 -04:00
|
|
|
return nil
|
|
|
|
}
|