Skip to content

cli: wire -max-time soft termination via goflags - #7589

Merged
dwisiswant0 merged 2 commits into
devfrom
5823-max-time
Jul 26, 2026
Merged

cli: wire -max-time soft termination via goflags#7589
dwisiswant0 merged 2 commits into
devfrom
5823-max-time

Conversation

@Mzack9999

@Mzack9999 Mzack9999 commented Jul 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Wire goflags AddCommonFlags so CLI supports -max-time / -mt for whole-run soft termination
  • Bump goflags to a revision that includes CommonFlags
  • Add a regression test that -max-time / -mt parse correctly

Closes #5823

Summary by CodeRabbit

  • New Features
    • Added shared command-line options, including maximum runtime controls.
    • Enabled configuring maximum runtime via -max-time and the -mt alias.
  • Tests
    • Added a test to verify -max-time and -mt are recognized and parsed correctly.
  • Chores
    • Updated dependency versions to the latest specified releases.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The nuclei CLI now registers shared goflags options, including max-time handling. Related dependencies are updated, and a test verifies -max-time and -mt duration parsing.

Changes

Common max-time flag

Layer / File(s) Summary
Dependency and CLI flag registration
go.mod, cmd/nuclei/main.go
Updates the DNS and goflags dependencies and registers common flags during configuration.
Max-time parsing coverage
cmd/nuclei/max_time_test.go
Verifies that -max-time and -mt parse into the expected durations.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit hops where flags now flow,
With max-time set from fast to slow.
“-mt,” I cheer, “and long form too!”
Tests guard the durations true.
The scan can pause with grace in view.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR adds -max-time wiring and tests, but it does not implement the linked jsonl direct-to-disk behavior. Add the jsonl direct-to-disk work requested in #5823, or split that requirement into a separate issue if it is deferred.
Out of Scope Changes check ⚠️ Warning The separate github.com/miekg/dns version bump appears unrelated to the max-time feature work and is not justified by the objectives. Remove the dns upgrade from this PR unless it is required for the feature, or move it to a separate dependency update.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change: wiring -max-time termination through goflags.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 5823-max-time

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread go.mod Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@go.mod`:
- Line 98: Update the github.com/projectdiscovery/goflags dependency in go.mod
to the exact pseudo-version v0.1.75-0.20260128114615-b0f98a3a8e6e, or verify
that v0.1.75 resolves and includes CommonFlags/AddCommonFlags before retaining
it. Ensure the selected revision provides the required CLI API.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: c8879347-2f79-4f92-ad4c-608aec30e38b

📥 Commits

Reviewing files that changed from the base of the PR and between 9ef5e62 and c2c65c4.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod

Comment thread go.mod
@dwisiswant0
dwisiswant0 merged commit 89d4300 into dev Jul 26, 2026
20 of 29 checks passed
@dwisiswant0
dwisiswant0 deleted the 5823-max-time branch July 26, 2026 04:29
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.

[FEATURE] -maxtime maximum testing time per host (soft kill) and -jsonl writes directly to disk

2 participants