Skip to content

Commit

Permalink
chore: adds inventory to create command and fixes create examples
Browse files Browse the repository at this point in the history
Signed-off-by: Jennifer Power <[email protected]>
  • Loading branch information
jpower432 committed Jan 12, 2023
1 parent 4b1beb5 commit 7aebd0e
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions cmd/client/commands/create.go
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion cmd/client/commands/create_inventory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit 7aebd0e

Please sign in to comment.