-
Notifications
You must be signed in to change notification settings - Fork 23
/
cmd.go
31 lines (25 loc) · 982 Bytes
/
cmd.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0
package routingslips
import (
"github.com/spf13/cobra"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/names"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/routingslips/add"
"github.com/open-component-model/ocm/cmds/ocm/commands/ocmcmds/routingslips/get"
"github.com/open-component-model/ocm/cmds/ocm/pkg/utils"
"github.com/open-component-model/ocm/pkg/contexts/clictx"
)
var Names = names.RoutingSlips
// NewCommand creates a new command.
func NewCommand(ctx clictx.Context) *cobra.Command {
cmd := utils.MassageCommand(&cobra.Command{
Short: "Commands working on routing slips",
}, Names...)
AddCommands(ctx, cmd)
return cmd
}
func AddCommands(ctx clictx.Context, cmd *cobra.Command) {
cmd.AddCommand(add.NewCommand(ctx, add.Verb))
cmd.AddCommand(get.NewCommand(ctx, get.Verb))
}