Documentation
¶
Overview ¶
Package app assembles a runnable CLI from products: the unified `reearth` binary (Run with several products) or a standalone product binary (Main).
Index ¶
- func Execute(f *core.Factory, o Options, args []string) int
- func Main(p core.Product)
- func NewFactory(o Options, io *iostreams.IOStreams) *core.Factory
- func NewRoot(f *core.Factory, o Options) *cobra.Command
- func RawFlag(args []string, name string, short ...string) (value string, ok bool)
- func Run(o Options, args []string) int
- type Factory
- type Options
- type Product
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFactory ¶
NewFactory creates the Factory shared by all commands.
Types ¶
type Options ¶
type Options struct {
// Name is the binary name ("reearth", "reearth-cms").
Name string
// Short describes the root command.
Short string
// Products are mounted as subcommands, or as the root when Standalone.
Products []core.Product
// Standalone makes the single product the root command.
Standalone bool
// Extra adds host-specific commands (upgrade, extension, ...).
Extra func(f *core.Factory) []*cobra.Command
// Dispatch may handle args before cobra (e.g. running an extension).
Dispatch func(f *core.Factory, root *cobra.Command, args []string) (handled bool, exitCode int)
// BeforeRun runs before the command; AfterRun after it, even on error.
BeforeRun func(f *core.Factory, args []string)
AfterRun func(f *core.Factory, cmd *cobra.Command, err error)
// DoctorChecks contributes extra checks to `doctor`.
DoctorChecks []func(ctx context.Context) []core.Check
}
Click to show internal directories.
Click to hide internal directories.