toolargs

package
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: AGPL-3.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommonAliases = map[string]string{
	"-etags": "-exclude-tags",
	"-eid":   "-exclude-id",
	"-es":    "-exclude-severity",
	"-tl":    "-template-list",
}

CommonAliases defines nuclei-style short flag aliases shared across tools.

Functions

func ArtifactResultID

func ArtifactResultID(tool, kind, target string, data any) string

ArtifactResultID returns a stable identity for one scanner-native record. The same value is carried by its aop.tool.Loot marker.

func BoolFlagEnabled

func BoolFlagEnabled(args []string, long string) bool

func GoFlagsHelp

func GoFlagsHelp(name string, data any) string

GoFlagsHelp renders help directly from go-flags struct tags.

func HasFlag

func HasFlag(args []string, long string) bool

func NewGoFlagsParser

func NewGoFlagsParser(name string, data any) *goflags.Parser

NewGoFlagsParser returns the parser shared by a scanner's runtime argument handling and generated help. Keeping both paths on the same options struct prevents the CLI documentation from drifting away from accepted flags.

func NormalizeFlags

func NormalizeFlags(args []string, known map[string]struct{}, aliases map[string]string) []string

NormalizeFlags converts single-dash flags to double-dash when they match a known flag, and applies alias mappings. Unknown flags pass through.

func ResolveRelativePaths

func ResolveRelativePaths(args []string, fileFlags map[string]bool, workDir string) []string

ResolveRelativePaths resolves relative file paths in args against workDir. fileFlags is the set of flags whose next argument (or =value) is a file path.

Types

type Base

type Base struct {
	Logger  telemetry.Logger
	Proxy   string
	WorkDir string
	Events  aop.EventEmitter
}

func (*Base) EmitArtifactCtx

func (b *Base) EmitArtifactCtx(ctx context.Context, tool, kind, target string, data any)

func (*Base) EmitArtifactResultCtx

func (b *Base) EmitArtifactResultCtx(ctx context.Context, resultID, tool, kind, target string, data any)

func (*Base) EmitLootCtx

func (b *Base) EmitLootCtx(
	ctx context.Context,
	resultID, tool, kind, target, priority, description, verificationStatus string,
	tags []string,
)

func (*Base) InitLogger

func (b *Base) InitLogger(logger telemetry.Logger)

func (*Base) SetProxy

func (b *Base) SetProxy(proxy string)

func (*Base) SetWorkDir

func (b *Base) SetWorkDir(dir string)

Jump to

Keyboard shortcuts

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