Skip to content

internal/cli

import "github.com/nuqs-org/nuqs/internal/cli"

Package cli is the "nuqs" command line. main.go only calls Run.

Everything the CLI needs from outside (Nmap, the list of checks) comes in through App, so tests can run the whole CLI without Nmap installed.

Constants

Exit codes returned by Run.

const (
    ExitOK    = 0 // everything worked (findings or not)
    ExitError = 1 // the scan couldn't run
    ExitUsage = 2 // the command was typed wrong
)

Defined in internal/cli/cli.go:23

Types

App

App holds what the CLI depends on.

type App struct {
    Version string
    Stdout  io.Writer
    Stderr  io.Writer
    // NewRunner returns the Nmap runner to use. The path comes from --nmap.
    NewRunner func(path string) nmap.Runner
    // Checks returns the checks to run.
    Checks func() []check.Check
}

Defined in internal/cli/cli.go:30

App.Run

Run runs the command in args (without the program name) and returns the exit code.

func (a *App) Run(ctx context.Context, args []string) int

Defined in internal/cli/cli.go:51