Documentation
¶
Index ¶
- func FormatMarkdown(results []Result) string
- func FormatReport(results []Result, format Format) (string, error)
- func FormatXML(results []Result) (string, error)
- func ResolveInput(stdin io.Reader, filePath string, args []string, isInputTTY bool) (string, error)
- type Action
- type Format
- type OnErrorBehavior
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatMarkdown ¶
FormatMarkdown formats the results as a Markdown report.
func FormatReport ¶
FormatReport dispatches to the appropriate formatter based on the format.
Types ¶
type Action ¶
Action represents a parsed command with its description.
func ParseActions ¶
ParseActions parses a text block into a slice of Actions.
Rules:
- Lines starting with # → strip "# " prefix, trim whitespace, set as description for the next action
- Lines ending with \ → join with next line (strip trailing \, strip leading whitespace from next, join with space)
- Blank lines → skip
- Any other line (or completed continuation) → becomes Command of a new Action
- No preceding # comment → Description is empty string
- Multiple consecutive # lines → last one wins
- Trailing # comment with no following command → ignored
type Format ¶
type Format string
Format represents the output format for the report.
func ParseFormat ¶
ParseFormat validates and returns a Format from a string.
type OnErrorBehavior ¶
type OnErrorBehavior string
OnErrorBehavior controls what happens when a command fails.
const ( Continue OnErrorBehavior = "continue" Stop OnErrorBehavior = "stop" )
func ParseOnErrorBehavior ¶
func ParseOnErrorBehavior(s string) (OnErrorBehavior, error)
ParseOnErrorBehavior validates and returns an OnErrorBehavior from a string.
type Result ¶
Result represents the outcome of executing an Action.
func ExecuteActions ¶
func ExecuteActions(actions []Action, onError OnErrorBehavior, shell string) []Result
ExecuteActions runs each action using the given shell and collects results. If onError is Stop and a command fails, execution halts and partial results are returned.