-
Notifications
You must be signed in to change notification settings - Fork 23
/
cmd.go
29 lines (24 loc) · 1.02 KB
/
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
// SPDX-FileCopyrightText: 2022 SAP SE or an SAP affiliate company and Open Component Model contributors.
//
// SPDX-License-Identifier: Apache-2.0
package resources
import (
"github.com/spf13/cobra"
"github.com/open-component-model/ocm/v2/cmds/ocm/commands/ocmcmds/names"
"github.com/open-component-model/ocm/v2/cmds/ocm/commands/ocmcmds/resources/add"
"github.com/open-component-model/ocm/v2/cmds/ocm/commands/ocmcmds/resources/download"
"github.com/open-component-model/ocm/v2/cmds/ocm/commands/ocmcmds/resources/get"
"github.com/open-component-model/ocm/v2/cmds/ocm/pkg/utils"
"github.com/open-component-model/ocm/v2/pkg/contexts/clictx"
)
var Names = names.Resources
// NewCommand creates a new command.
func NewCommand(ctx clictx.Context) *cobra.Command {
cmd := utils.MassageCommand(&cobra.Command{
Short: "Commands acting on component resources",
}, Names...)
cmd.AddCommand(add.NewCommand(ctx, add.Verb))
cmd.AddCommand(get.NewCommand(ctx, get.Verb))
cmd.AddCommand(download.NewCommand(ctx, download.Verb))
return cmd
}