diff --git a/cmd/client/commands/create.go b/cmd/client/commands/create.go new file mode 100644 index 00000000..174380e6 --- /dev/null +++ b/cmd/client/commands/create.go @@ -0,0 +1,37 @@ +package commands + +import ( + "github.com/spf13/cobra" + + "github.com/uor-framework/uor-client-go/cmd/client/commands/options" +) + +// CreateOptions describe configuration options that can +// be set using the create subcommand. +type CreateOptions struct { + *options.Common + options.Remote + options.RemoteAuth +} + +// NewCreateCmd creates a new cobra.Command for the create subcommand. +func NewCreateCmd(common *options.Common) *cobra.Command { + o := CreateOptions{Common: common} + + cmd := &cobra.Command{ + Use: "create", + Short: "Create artifacts from existing OCI artifacts", + SilenceErrors: false, + SilenceUsage: false, + RunE: func(cmd *cobra.Command, _ []string) error { + return cmd.Help() + }, + } + + o.Remote.BindFlags(cmd.PersistentFlags()) + o.RemoteAuth.BindFlags(cmd.PersistentFlags()) + + cmd.AddCommand(NewInventoryCmd(&o)) + + return cmd +} diff --git a/cmd/client/commands/create_inventory.go b/cmd/client/commands/create_inventory.go index 4f61cf2b..622528c6 100644 --- a/cmd/client/commands/create_inventory.go +++ b/cmd/client/commands/create_inventory.go @@ -43,7 +43,7 @@ type InventoryOptions struct { var clientInventoryExamples = examples.Example{ RootCommand: filepath.Base(os.Args[0]), Descriptions: []string{"Build inventory from artifacts."}, - CommandString: "inventory localhost:5000/myartifacts:latest", + CommandString: "create inventory localhost:5000/myartifacts:latest", } const (