Documentation
¶
Overview ¶
Package root builds the cr root command and owns root-level command wiring.
Index ¶
- func AddJSONFlag(cmd *cobra.Command, target *bool)
- func Execute(cmd *cobra.Command, args []string) error
- func NewProgressLogger(opts *Options) *progress.Logger
- func ProfileFlagChanged(cmd *cobra.Command) bool
- func RegisterAll(cmd *cobra.Command, opts *Options, fns ...RegisterFunc)
- type Options
- type RegisterFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddJSONFlag ¶ added in v0.10.228
AddJSONFlag adds the shared --json output flag to cmd.
func NewProgressLogger ¶ added in v0.10.228
NewProgressLogger returns a progress logger configured from root options.
func ProfileFlagChanged ¶ added in v0.3.77
ProfileFlagChanged reports whether the inherited --profile flag was supplied.
func RegisterAll ¶
func RegisterAll(cmd *cobra.Command, opts *Options, fns ...RegisterFunc)
RegisterAll applies child-command registrars to a root command tree.
Types ¶
type Options ¶
type Options struct {
Profile string
Backend string
ConfigPath string
Quiet bool
Stdin io.Reader
Stdout io.Writer
Stderr io.Writer
}
Options carries root-level command dependencies and persistent options.
func DefaultOptions ¶
func DefaultOptions() *Options
DefaultOptions returns root options wired to the process stdio streams.
type RegisterFunc ¶
RegisterFunc attaches a command subtree to the root command.
Click to show internal directories.
Click to hide internal directories.