toolargs

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

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 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
	DataBus *eventbus.Bus[output.ToolDataEvent]
}

func (*Base) EmitData

func (b *Base) EmitData(tool, kind, target string, data any)

func (*Base) EmitDataCtx

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

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