Skip to content

Conversation

@Ullaakut
Copy link
Owner

Goal of this PR

Fixes #360

  • Adds an option -o or --output-file to specify an output file. Results are written in JSON.
  • Updates documentation accordingly

@Ullaakut Ullaakut requested a review from Copilot July 13, 2025 19:13
@Ullaakut Ullaakut self-assigned this Jul 13, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds the ability to export scan results to a JSON file via a new CLI flag and implements the underlying write logic.

  • Introduces Scanner.Write to serialize streams to JSON and write to a file
  • Adds an -o, --output-file flag in the main command to specify the output path
  • Updates README to document the new output-file option

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
summary.go Added Write method on Scanner for JSON output
cmd/cameradar/cameradar.go Defined output-file flag handling and call to Write
README.md Documented the -o, --output-file option
Comments suppressed due to low confidence (2)

README.md:124

  • The README entry does not specify a default path or indicate how the absence of this flag is handled. Consider clarifying the default behavior or adding the default filename/path in the description.
* **"-o, --output-file"**: Output scan results as a JSON file. If not specified, results are not written to a file.

summary.go:74

  • There are no unit tests for the new Write method. Adding tests for successful JSON output and error paths (e.g., marshal failure or write errors) will improve reliability.
func (s *Scanner) Write(wc io.WriteCloser, streams []Stream) error {

@Ullaakut Ullaakut merged commit 4c39e60 into master Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

regression: missing --nmap-output option

2 participants