Documentation
¶
Overview ¶
Package cmdutil provides shared utilities for scry subcommands.
Index ¶
- func ApplyGlobalOverrides(cmd *cli.Command, cfg *config.Config)
- func DetermineExitCode(ctx context.Context, result *model.CrawlResult, failOn string) int
- func NormalizeURL(u string) string
- func ReadURLsFromFile(path string) (_ []string, readErr error)
- func ReportAndExit(ctx context.Context, cfg *config.Config, result *model.CrawlResult) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyGlobalOverrides ¶
ApplyGlobalOverrides applies the global CLI flags (output, output-file, fail-on) from the parent command to the config, only when explicitly set.
func DetermineExitCode ¶
DetermineExitCode checks if any issues meet the fail-on threshold. An unrecognised failOn value is logged as a warning and treated as no threshold (exit 0).
func NormalizeURL ¶
NormalizeURL adds an https:// prefix if no scheme is present.
func ReadURLsFromFile ¶
ReadURLsFromFile reads one URL per line from a file, trimming whitespace and skipping blank lines and lines starting with #.
func ReportAndExit ¶
ReportAndExit writes reports to the configured outputs and returns an exit code error if issues exceed the fail-on threshold.
Types ¶
This section is empty.