2019-10-19 16:24:16 +05:30
|
|
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
2023-09-08 07:10:02 +05:30
|
|
|
// SPDX-License-Identifier: MIT
|
2019-10-19 16:24:16 +05:30
|
|
|
|
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
2020-12-16 21:48:10 +05:30
|
|
|
"fmt"
|
2019-10-19 16:24:16 +05:30
|
|
|
|
2020-09-30 10:41:33 +05:30
|
|
|
"code.gitea.io/tea/cmd/labels"
|
2020-01-04 23:14:25 +05:30
|
|
|
"github.com/urfave/cli/v2"
|
2019-10-19 16:24:16 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
// CmdLabels represents to operate repositories' labels.
|
|
|
|
var CmdLabels = cli.Command{
|
|
|
|
Name: "labels",
|
2020-10-02 21:16:51 +05:30
|
|
|
Aliases: []string{"label"},
|
2020-12-21 19:07:20 +05:30
|
|
|
Category: catEntities,
|
2019-11-04 02:04:41 +05:30
|
|
|
Usage: "Manage issue labels",
|
|
|
|
Description: `Manage issue labels`,
|
2022-09-13 23:44:02 +05:30
|
|
|
ArgsUsage: " ", // command does not accept arguments
|
2019-10-19 16:24:16 +05:30
|
|
|
Action: runLabels,
|
2020-01-04 23:14:25 +05:30
|
|
|
Subcommands: []*cli.Command{
|
2020-12-09 00:36:15 +05:30
|
|
|
&labels.CmdLabelsList,
|
2020-09-30 10:41:33 +05:30
|
|
|
&labels.CmdLabelCreate,
|
|
|
|
&labels.CmdLabelUpdate,
|
|
|
|
&labels.CmdLabelDelete,
|
2019-10-19 16:24:16 +05:30
|
|
|
},
|
2021-05-13 00:02:20 +05:30
|
|
|
Flags: labels.CmdLabelsList.Flags,
|
2019-10-19 16:24:16 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
func runLabels(ctx *cli.Context) error {
|
2020-12-09 00:36:15 +05:30
|
|
|
if ctx.Args().Len() == 1 {
|
|
|
|
return runLabelsDetails(ctx)
|
2019-10-19 16:24:16 +05:30
|
|
|
}
|
2020-12-09 00:36:15 +05:30
|
|
|
return labels.RunLabelsList(ctx)
|
|
|
|
}
|
2019-10-19 16:24:16 +05:30
|
|
|
|
2020-12-09 00:36:15 +05:30
|
|
|
func runLabelsDetails(ctx *cli.Context) error {
|
2020-12-16 21:48:10 +05:30
|
|
|
return fmt.Errorf("Not yet implemented")
|
2019-10-19 16:24:16 +05:30
|
|
|
}
|