Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigRule ¶
type ConfigRule struct {
// contains filtered or unexported fields
}
ConfigRule is a service struct to handle config.Rule for cmd applications
func NewConfigRule ¶
func NewConfigRule(currentCmdPath string) *ConfigRule
NewConfigRule returns a new pointer instance of ConfigRule with the given arguments
func (ConfigRule) CurrentRule ¶
func (c ConfigRule) CurrentRule() (config.Rule, error)
CurrentRule returns the current rule with applies to the path the cmd is executed in
type DynamicFlagConfig ¶
type DynamicFlagConfig struct { // The type of command for which the dynamic flags should be used for. Must be one of: // branch || commit CommandType string `validate:"oneof='branch' 'commit'"` // contains filtered or unexported fields }
DynamicFlagConfig is a service struct for handling dynamic flags for Cobra commands based on config.Rule
func NewDynamicFlagConfig ¶
func NewDynamicFlagConfig(commandType string, configRule config.Rule) (*DynamicFlagConfig, error)
NewDynamicFlagConfig returns a new pointer instance of DynamicFlagConfig with the given arguments
func (DynamicFlagConfig) AddFlagsForCmd ¶
func (d DynamicFlagConfig) AddFlagsForCmd(cmd *cobra.Command)
AddFlagsForCmd adds the DynamicFlagConfig.configRule defined flags to the cmd
Click to show internal directories.
Click to hide internal directories.