mirror of
https://github.com/rapid7/metasploitable3.git
synced 2024-06-30 08:45:50 +02:00
Use optparse
This commit is contained in:
parent
de48f797a6
commit
b67f807f25
19
Vagrantfile
vendored
19
Vagrantfile
vendored
|
@ -1,24 +1,23 @@
|
||||||
# -*- mode: ruby -*-
|
# -*- mode: ruby -*-
|
||||||
# vi: set ft=ruby :
|
# vi: set ft=ruby :
|
||||||
|
|
||||||
require 'getoptlong'
|
require 'optparse'
|
||||||
|
|
||||||
opts = GetoptLong.new(
|
|
||||||
[ '--difficulty', GetoptLong::OPTIONAL_ARGUMENT ]
|
|
||||||
)
|
|
||||||
|
|
||||||
difficulty = :normal
|
difficulty = :normal
|
||||||
|
|
||||||
opts.each do |opt, arg|
|
opts = OptionParser.new do |opts|
|
||||||
case opt
|
opts.banner = 'Metasploitable3 options:'
|
||||||
when '--difficulty'
|
|
||||||
case arg
|
opts.on('-d', '--difficulty <String>', 'Level of difficulty') do |v|
|
||||||
when /^easy$/i
|
if v =~ /^easy$/i
|
||||||
difficulty = :easy
|
difficulty = :easy
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
opts.parse!(ARGV)
|
||||||
|
|
||||||
|
|
||||||
Vagrant.configure("2") do |config|
|
Vagrant.configure("2") do |config|
|
||||||
# Base configuration for the VM and provisioner
|
# Base configuration for the VM and provisioner
|
||||||
config.vm.box = "metasploitable3"
|
config.vm.box = "metasploitable3"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user