MCPcopy Index your code
hub / github.com/git-bug/git-bug / newLabelCommand

Function newLabelCommand

commands/label.go:9–23  ·  view source on GitHub ↗
(env *execenv.Env)

Source from the content-addressed store, hash-verified

7)
8
9func newLabelCommand(env *execenv.Env) *cobra.Command {
10 cmd := &cobra.Command{
11 Use: "label",
12 Short: "List valid labels",
13 Long: `List valid labels.
14
15Note: in the future, a proper label policy could be implemented where valid labels are defined in a configuration file. Until that, the default behavior is to return the list of labels already used.`,
16 PreRunE: execenv.LoadBackend(env),
17 RunE: execenv.CloseBackend(env, func(cmd *cobra.Command, args []string) error {
18 return runLabel(env)
19 }),
20 }
21
22 return cmd
23}
24
25func runLabel(env *execenv.Env) error {
26 labels := env.Backend.Bugs().ValidLabels()

Callers 1

NewRootCommandFunction · 0.85

Calls 3

LoadBackendFunction · 0.92
CloseBackendFunction · 0.92
runLabelFunction · 0.85

Tested by

no test coverage detected