cmd

package
v0.0.0-...-7b2af25 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version = ""
	Commit  = ""
)
View Source
var (
	HomeFlag = "home"
)

Functions

func BuildDefaultCmd

func BuildDefaultCmd(config *Config) cli.Executor

BuildDefaultCmd allows to build cli Executor containing a root command that has name, description, version, init and start commands implementations

func PrepareRootCmd

func PrepareRootCmd(name string, cmd *cobra.Command) cli.Executor

PrepareRootCmd prepares the given command binding all the viper flags

func RootCmd

func RootCmd(name string) *cobra.Command

RootCmd allows to build the default root command with the given name

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config represents configuration for "init" and "start" commands

func NewCmdConfig

func NewCmdConfig(name string) *Config

NewCmdConfig allows to build a new Config instance

func (*Config) GetInitConfig

func (c *Config) GetInitConfig() *initcmd.Config

GetInitConfig returns the config used during init command

func (*Config) GetName

func (c *Config) GetName() string

GetName returns the name of the root command

func (*Config) GetStartConfig

func (c *Config) GetStartConfig() *startcmd.StartConfig

GetStartConfig returns the config used during start command

func (*Config) StartConfig

func (c *Config) StartConfig(cfg *startcmd.StartConfig) *Config

StartConfig sets cfg as the start command configuration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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