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 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.