Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCachedParam ¶
func NormalizeLegacyLongFlagArgs ¶
NormalizeLegacyLongFlagArgs converts legacy args style: -db -> --db Only handles "single dash + multiple chars" args, preserves short args like -l/-h
func RegParamToCobra ¶
RegParamToCobra registers parameters to cobra command cobra parses parameters and stores values in the returned map
Types ¶
type ParamMap ¶
ParamMap is a map of parameter values
func GetCachedParamMap ¶
GetCachedParamMap interactively prompts user for parameter values with defaults Uses cached values from previous runs when available
func ParseParamFromCobra ¶
ParseParamFromCobra extracts parameter values from cobra flag refs to ParamMap
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
Tool provides unified CLI/Interactive/GUI tool execution
func (*Tool) NewCobraCommand ¶
NewCobraCommand creates a cobra command for CLI mode
func (*Tool) RunCommand ¶
RunCommand runs the tool with command-line arguments
func (*Tool) RunInteractive ¶
func (x *Tool) RunInteractive()
RunInteractive runs the tool in interactive mode with cached parameters
type ToolOption ¶
type ToolOption struct {
ToolName string
Use string
Aliases []string
Short string
CacheKeyPrefix string
ParamList []ParamItem
Run func(values ParamMap) error
// InteractiveHook allows additional interactive configuration beyond params
InteractiveHook func(values ParamMap) ParamMap
// CobraSetup allows additional cobra configuration
CobraSetup func(cmd *cobra.Command) func(values ParamMap) ParamMap
}
ToolOption contains configuration for a tool entrypoint