Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple output files #156

Merged

Conversation

AI-Mozi
Copy link
Member

@AI-Mozi AI-Mozi commented Aug 18, 2024

#118

Loose idea, let me know what do you think @postmodern

@AI-Mozi AI-Mozi self-assigned this Aug 18, 2024
Copy link
Member

@postmodern postmodern left a comment

Choose a reason for hiding this comment

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

Noticed a few things, but generally I like how it's implemented!

lib/ronin/recon/cli/commands/run.rb Outdated Show resolved Hide resolved
options[:output_format].open(options[:output])
end
output_files = outputs.filter_map do |output, output_format|
output_format.open(output) if output && output_format
Copy link
Member

Choose a reason for hiding this comment

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

The output && output_format test might not be necessary. Double checking OutputFormats.infer_from, it appears to default to OutputFormats::TXT, so we should always have an output format.

Ronin::Recon::OutputFormats.infer_from('foo.lol')
# => Ronin::Core::OutputFormats::TXT

Copy link
Member Author

Choose a reason for hiding this comment

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

I removed only the output_format just to be 100% sure there is always an output

Copy link
Member

@postmodern postmodern Aug 19, 2024

Choose a reason for hiding this comment

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

There should always be path value if the --output option is given, since the argument is required.

lib/ronin/recon/cli/commands/run.rb Show resolved Hide resolved
spec/cli/commands/run_spec.rb Show resolved Hide resolved
@AI-Mozi AI-Mozi force-pushed the add_support_for_multiple_output_files branch from 28a09b2 to 3de7e81 Compare August 19, 2024 07:23
@AI-Mozi AI-Mozi force-pushed the add_support_for_multiple_output_files branch from 3de7e81 to 7446b66 Compare August 27, 2024 14:14
@AI-Mozi AI-Mozi force-pushed the add_support_for_multiple_output_files branch from 7446b66 to 7d75441 Compare August 27, 2024 14:16
@postmodern postmodern added feature New Feature command-option Command option labels Aug 28, 2024
@postmodern postmodern added this to the 0.2.0 milestone Aug 28, 2024
@postmodern postmodern merged commit b63b583 into ronin-rb:0.2.0 Aug 28, 2024
4 checks passed
@postmodern postmodern added the output-format Output file formats label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
command-option Command option feature New Feature output-format Output file formats
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants