Skip to content

Commit a6ba9ee

Browse files
committed
Added --output-dir to ronin-recon run (closes #180).
1 parent 716d238 commit a6ba9ee

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

Diff for: lib/ronin/recon/cli/commands/run.rb

+9
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ module Commands
5656
# -I, --ignore VALUE The values to ignore in result
5757
# -F txt|list|csv|json|ndjson|dot|svg|png|pdf,
5858
# --output-format The output format
59+
# --output-dir DIR Writes data to an output directory
5960
# --import Imports each newly discovered value into the Ronin database
6061
# -h, --help Print help information
6162
#
@@ -153,6 +154,14 @@ class Run < Command
153154
},
154155
desc: 'The output format'
155156

157+
option :output_dir, value: {
158+
type: String,
159+
usage: 'DIR'
160+
},
161+
desc: 'Writes data to an output directory' do |path|
162+
@outputs << [path, OutputFormats::Dir]
163+
end
164+
156165
option :import, desc: 'Imports each newly discovered value into the Ronin database'
157166

158167
option :ignore, short: '-I',

Diff for: man/ronin-recon-run.1.md

+3
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ Runs the recon engine with one or more initial values.
7070
: The output format. If not specified, the output format will be inferred from
7171
the `--output` *FILE* extension.
7272

73+
`--output-dir` *DIR*
74+
: Writes the output to a directory of separate files for each value type.
75+
7376
`--import`
7477
: Imports each newly discovered value into the Ronin database.
7578

Diff for: spec/cli/commands/run_spec.rb

+11
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,17 @@
162162
end
163163
end
164164

165+
context "when the '--output-dir' option is given" do
166+
let(:path) { 'path/to/dir' }
167+
let(:argv) { ['--output-dir', path] }
168+
169+
it "must add the output directory path to #outputs" do
170+
expect(subject.outputs).to eq([
171+
[path, Ronin::Recon::OutputFormats::Dir]
172+
])
173+
end
174+
end
175+
165176
context "when the '--ignore' option is given" do
166177
let(:value1) { Ronin::Recon::Values::Host.new('staging.example.com') }
167178
let(:value2) { Ronin::Recon::Values::Host.new('dev.example.com') }

0 commit comments

Comments
 (0)