command

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: MIT Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachCustomerCommands added in v0.1.1

func AttachCustomerCommands(cmd *cobra.Command, commandOpts RootCommandOptions)

AttachCustomerCommands wires the full customer command tree (auth, iam, vm, disk, network, ...) onto a root that's already been built by pkg/metalhostcli/runtime.NewRootCommand. Use this when something else owns the bare root setup — typically the metalhostcli package wrapping a runtime-built root for the `metalhost` binary.

The persistent flags on `cmd` are bound to runtime's rootOptions, not ours. We bridge by re-reading flag values into our struct in PersistentPreRunE, which cobra invokes on the root before any leaf RunE.

func NewRootCommand

func NewRootCommand() *cobra.Command

func NewRootCommandWithOptions

func NewRootCommandWithOptions(commandOpts RootCommandOptions) *cobra.Command

NewRootCommandWithOptions builds a fully-loaded customer CLI root in one call. Used by the in-package tests and as a back-compat single-shot entry point. The two-step path (runtime.NewRootCommand → AttachCustomerCommands) is preferred for callers who want to opt out of the customer command tree.

Types

type RootCommandOptions

type RootCommandOptions struct {
	Use       string
	Short     string
	UserAgent string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL