2019-10-19 12:54:16 +02: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 (
|
2020-12-16 17:18:10 +01:00
|
|
|
"fmt"
|
2019-10-19 12:54:16 +02:00
|
|
|
|
2020-09-30 07:11:33 +02:00
|
|
|
"code.gitea.io/tea/cmd/labels"
|
2020-01-04 18:44:25 +01:00
|
|
|
"github.com/urfave/cli/v2"
|
2019-10-19 12:54:16 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
// CmdLabels represents to operate repositories' labels.
|
|
|
|
var CmdLabels = cli.Command{
|
|
|
|
Name: "labels",
|
2020-10-02 17:46:51 +02:00
|
|
|
Aliases: []string{"label"},
|
2020-12-21 14:37:20 +01:00
|
|
|
Category: catEntities,
|
2019-11-03 21:34:41 +01:00
|
|
|
Usage: "Manage issue labels",
|
|
|
|
Description: `Manage issue labels`,
|
2022-09-13 20:14:02 +02:00
|
|
|
ArgsUsage: " ", // command does not accept arguments
|
2019-10-19 12:54:16 +02:00
|
|
|
Action: runLabels,
|
2020-01-04 18:44:25 +01:00
|
|
|
Subcommands: []*cli.Command{
|
2020-12-08 20:06:15 +01:00
|
|
|
&labels.CmdLabelsList,
|
2020-09-30 07:11:33 +02:00
|
|
|
&labels.CmdLabelCreate,
|
|
|
|
&labels.CmdLabelUpdate,
|
|
|
|
&labels.CmdLabelDelete,
|
2019-10-19 12:54:16 +02:00
|
|
|
},
|
2021-05-12 20:32:20 +02:00
|
|
|
Flags: labels.CmdLabelsList.Flags,
|
2019-10-19 12:54:16 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func runLabels(ctx *cli.Context) error {
|
2020-12-08 20:06:15 +01:00
|
|
|
if ctx.Args().Len() == 1 {
|
|
|
|
return runLabelsDetails(ctx)
|
2019-10-19 12:54:16 +02:00
|
|
|
}
|
2020-12-08 20:06:15 +01:00
|
|
|
return labels.RunLabelsList(ctx)
|
|
|
|
}
|
2019-10-19 12:54:16 +02:00
|
|
|
|
2020-12-08 20:06:15 +01:00
|
|
|
func runLabelsDetails(ctx *cli.Context) error {
|
2020-12-16 17:18:10 +01:00
|
|
|
return fmt.Errorf("Not yet implemented")
|
2019-10-19 12:54:16 +02:00
|
|
|
}
|