Skip to content

Commit

Permalink
Renamed run --target-version to run --target-software-version (#148
Browse files Browse the repository at this point in the history
…).
  • Loading branch information
postmodern committed Aug 7, 2024
1 parent a1f3346 commit 6afe190
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions lib/ronin/exploits/cli/commands/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ module Commands
# --target-os Selects the target with the matching OS
# --target-os-version VERSION Selects the target with the matching OS version
# -S, --target-software NAME Selects the target with the matching software name
# -V, --target-version VERSION Selects the target with the matching software version
# -V VERSION, Selects the target with the matching software version
# --target-software-version
# -L, --save-loot DIR Saves any found loot to the DIR
# -d, --debug Enables debugging messages
# --irb Open an interactive Ruby shell inside the exploit
Expand Down Expand Up @@ -200,14 +201,14 @@ class Run < ExploitCommand
@target_kwargs[:software] = software
end

option :target_version, short: '-V',
value: {
type: String,
usage: 'VERSION'
},
desc: 'Selects the target with the matching software version' do |version|
@target_kwargs[:version] = version
end
option :target_software_version, short: '-V',
value: {
type: String,
usage: 'VERSION'
},
desc: 'Selects the target with the matching software version' do |version|
@target_kwargs[:software_version] = version
end

option :save_loot, short: '-L',
value: {
Expand Down
2 changes: 1 addition & 1 deletion man/ronin-exploits-run.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Loads and runs an exploit.
`-S`, `--target-software` *NAME*
: Selects the target with the matching software name.

`-V`, `--target-version` *VERSION*
`-V`, `--target-software-version` *VERSION*
: Selects the target with the matching software version.

`-L`, `--save-loot` *DIR*
Expand Down
4 changes: 2 additions & 2 deletions spec/cli/commands/run_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@
context "when parsing '--target-software-version VERSION'" do
let(:software_version) { '1.2.3' }

let(:argv) { ['--target-version', software_version] }
let(:argv) { ['--target-software-version', software_version] }
before { subject.option_parser.parse(argv) }

it "must set :version in the #target_kwargs Hash to the given software version" do
expect(subject.target_kwargs[:version]).to eq(software_version)
expect(subject.target_kwargs[:software_version]).to eq(software_version)
end
end
end
Expand Down

0 comments on commit 6afe190

Please sign in to comment.