cmdutil

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package cmdutil provides shared utilities for scry subcommands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyGlobalOverrides

func ApplyGlobalOverrides(cmd *cli.Command, cfg *config.Config)

ApplyGlobalOverrides applies the global CLI flags (output, output-file, fail-on) from the parent command to the config, only when explicitly set.

func DetermineExitCode

func DetermineExitCode(ctx context.Context, result *model.CrawlResult, failOn string) int

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

func NormalizeURL(u string) string

NormalizeURL adds an https:// prefix if no scheme is present.

func ReadURLsFromFile

func ReadURLsFromFile(path string) (_ []string, readErr error)

ReadURLsFromFile reads one URL per line from a file, trimming whitespace and skipping blank lines and lines starting with #.

func ReportAndExit

func ReportAndExit(ctx context.Context, cfg *config.Config, result *model.CrawlResult) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL