Documentation ¶
Index ¶
- func NewCLICommand(cmd *cobra.Command, opts ...Option) (ppi.Command, error)
- type CobraCommand
- func (c *CobraCommand) CLIConfigRequired() bool
- func (c *CobraCommand) Command() *cobra.Command
- func (c *CobraCommand) Description() string
- func (c *CobraCommand) Example() string
- func (c *CobraCommand) Name() string
- func (c *CobraCommand) ObjectType() string
- func (c *CobraCommand) Realm() string
- func (c *CobraCommand) Short() string
- func (c *CobraCommand) Usage() string
- func (c *CobraCommand) Verb() string
- type Option
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCLICommand ¶
NewCLICommand created a CLI command based on a preconfigured cobra.Command. Optionally, a verb can be specified. If given additionally a realm can be given. verb and realm are used to add the command at the appropriate places in the command hierarchy of the ocm CLI. If nothing is specified, the command will be a new top-level command. To access the configured ocm context use the Context attribute of the cobra command. The ocm context is bound to it.
ocm.FromContext(cmd.Context())
Types ¶
type CobraCommand ¶
type CobraCommand struct {
// contains filtered or unexported fields
}
func (*CobraCommand) CLIConfigRequired ¶
func (c *CobraCommand) CLIConfigRequired() bool
func (*CobraCommand) Command ¶
func (c *CobraCommand) Command() *cobra.Command
func (*CobraCommand) Description ¶
func (c *CobraCommand) Description() string
func (*CobraCommand) Example ¶
func (c *CobraCommand) Example() string
func (*CobraCommand) Name ¶
func (c *CobraCommand) Name() string
func (*CobraCommand) ObjectType ¶
func (c *CobraCommand) ObjectType() string
func (*CobraCommand) Realm ¶
func (c *CobraCommand) Realm() string
func (*CobraCommand) Short ¶
func (c *CobraCommand) Short() string
func (*CobraCommand) Usage ¶
func (c *CobraCommand) Usage() string
func (*CobraCommand) Verb ¶
func (c *CobraCommand) Verb() string
Click to show internal directories.
Click to hide internal directories.