tea/cmd/labels.go

41 lines
917 B
Go
Raw Normal View History

2019-10-19 10:54:16 +00:00
// Copyright 2019 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
2019-10-19 10:54:16 +00:00
package cmd
import (
"fmt"
2019-10-19 10:54:16 +00:00
"code.gitea.io/tea/cmd/labels"
"github.com/urfave/cli/v2"
2019-10-19 10:54:16 +00:00
)
// CmdLabels represents to operate repositories' labels.
var CmdLabels = cli.Command{
Name: "labels",
Aliases: []string{"label"},
Category: catEntities,
Usage: "Manage issue labels",
Description: `Manage issue labels`,
ArgsUsage: " ", // command does not accept arguments
2019-10-19 10:54:16 +00:00
Action: runLabels,
Subcommands: []*cli.Command{
&labels.CmdLabelsList,
&labels.CmdLabelCreate,
&labels.CmdLabelUpdate,
&labels.CmdLabelDelete,
2019-10-19 10:54:16 +00:00
},
Flags: labels.CmdLabelsList.Flags,
2019-10-19 10:54:16 +00:00
}
func runLabels(ctx *cli.Context) error {
if ctx.Args().Len() == 1 {
return runLabelsDetails(ctx)
2019-10-19 10:54:16 +00:00
}
return labels.RunLabelsList(ctx)
}
2019-10-19 10:54:16 +00:00
func runLabelsDetails(ctx *cli.Context) error {
return fmt.Errorf("Not yet implemented")
2019-10-19 10:54:16 +00:00
}