Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCommand ¶
BuildCommand reconstructs the command from executable, args, and current values. This strips all type hints and uses the actual values.
func InferType ¶
InferType infers the type of a value based on its content. Returns "number", "bool", or "string".
func IntrospectScript ¶
IntrospectScript runs the script with --help and parses flag descriptions. Returns a map of flag name → description. If --help fails or returns no useful info, returns an empty map (no error).
Types ¶
type ExecArg ¶
type ExecArg struct {
Name string `json:"name"` // "name" or "arg1" for positional
Label string `json:"label"` // Display label (custom or auto-generated)
Type string `json:"type"` // "string", "number", "bool"
Default string `json:"default"` // Default value as string
Position int `json:"position"` // -1 for named flags, 0+ for positional
Description string `json:"description"` // From --help introspection
}
ExecArg represents a parsed command-line argument
func ParseExecCommand ¶
ParseExecCommand parses a command string and extracts the executable and arguments. Supports:
- Named args: --flag:type value or --flag value (type inferred)
- Positional args: label:type:value or label:value or just value
All type hints are stripped from the returned args - they're only used to determine the input type for form generation.