Skip to content

nmap C→Rust — M1: verbosity pulled forward (core::options -v/-d + core::log) - #3

Merged
kj299 merged 1 commit into
masterfrom
claude/m1-verbosity
Jul 9, 2026
Merged

kj299 merged 1 commit into
masterfrom
claude/m1-verbosity

Conversation

@kj299

@kj299 kj299 commented Jul 9, 2026

Copy link
Copy Markdown
Owner

What this is

A Milestone 1 slice that pulls leveled verbosity/debugging forward — before the scan modules — so every module built afterward (ports, net, connect_scan, output) is diagnosable during development. Previously the CLI handled only --version and the sole hook was the binary NMAP_RS_TRACE env var.

First use of the per-milestone-branch workflow (fresh branch off master, always fast-forward).

Changes

  • core::options — RunConfig, the growing NmapOps analog, with a faithful -v/-d parser (nmap o.verbose/o.debugging, box(0,10,·)):
    • -v/-vv/-vvv increment; -vN sets; --verbose bumps once.
    • -d/-dd/-dN bump/set both debugging and verbose (matches nmap's o.debugging = o.verbose = …).
    • --version, -h/--help, positional targets; unknown flags are recorded, never silently dropped or mis-read as targets.
    • Pure and panic-free (unit-testable without a process).
  • core::log — leveled verbose!/debug! macros to stderr (keeps stdout differential-clean); levels set once at startup. Complements trace! (env-gated, for the harness).
  • cli — parses args → log::init → version/help/unknown-flag warnings; verbosity is live.
  • PLAN.md — records verbosity pulled forward (now module 3 of the M1 loop); status tracker refreshed.

Verified

  • fmt + clippy(-D warnings) + 25 unit tests + unsafe-audit (0 undocumented), all green.
  • Manual runtime checks: a plain run emits zero stderr (differential-safe); -v prints verbose output only; -d1 adds [nmap-rs debug] diagnostics with the full parsed config.

🤖 Generated with Claude Code


Generated by Claude Code

Integrate leveled verbosity/debugging early (before the scan modules) so every
subsequent module is diagnosable during development — the CLI previously handled
only --version and the sole hook was the binary NMAP_RS_TRACE env var.

- core::options: RunConfig (the growing NmapOps analog) + faithful -v/-d parse
  (o.verbose/o.debugging, box(0,10,.)): -v/-vv increment, -vN sets, -d bumps both
  debugging AND verbose, --version/-h + positional targets; unknown flags are
  recorded (not silently dropped / mis-read as targets). Pure, panic-free.
- core::log: leveled verbose!/debug! macros to STDERR (keeps stdout differential-
  clean); levels set once at startup. Complements trace! (env-gated, harness use).
- cli: parse args -> log::init -> version/help/warn; verbosity is live.
- PLAN.md: record verbosity pulled forward (module 3); tracker refreshed.

Gates: fmt + clippy(-D) + 25 tests + unsafe-audit(0), and manual run checks:
plain run emits zero stderr; -v prints verbose only; -d1 adds [nmap-rs debug].

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JfEzHqD7a7TKDuUs5GwZ2w
@kj299
kj299 marked this pull request as ready for review July 9, 2026 13:40
@kj299
kj299 merged commit b5ecf54 into master Jul 9, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants