cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package cli is the command line shared by the engine binary and the thin per-detector binaries (emudhra-scan, php2shell-scan), which pin one detector and keep their old command names, flags and exit status rules.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(c Config, args []string, stdout, stderr io.Writer) int

Run runs the command line and returns the exit status.

func SetMemoryLimit

func SetMemoryLimit()

SetMemoryLimit keeps the heap near what is actually live: archive members and large files are held one at a time, and without a limit the collector lets the heap grow to about twice that. GOMEMLIMIT in the environment wins.

Types

type Config

type Config struct {
	Tool    string
	Version string
	// Detector pins a single detector (thin binaries). Empty: --detector picks.
	Detector string
	// Summary is the first line of the usage text.
	Summary string
	// AsRootDir makes --as-root take the system root directory as its value
	// (php2shell-scan) instead of being a switch (emudhra-scan).
	AsRootDir bool
	// ErrorsFirst makes an error exit 2 even when something is vulnerable, and
	// --exit-zero override everything else (php2shell-scan). Otherwise a
	// vulnerable finding exits 1 first (emudhra-scan, the engine).
	ErrorsFirst bool
}

Config describes one binary.

Jump to

Keyboard shortcuts

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