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