Use optparse

This commit is contained in:
wchen-r7 2016-11-08 14:30:35 -06:00
parent de48f797a6
commit b67f807f25

19
Vagrantfile vendored
View File

@ -1,24 +1,23 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
require 'getoptlong'
opts = GetoptLong.new(
[ '--difficulty', GetoptLong::OPTIONAL_ARGUMENT ]
)
require 'optparse'
difficulty = :normal
opts.each do |opt, arg|
case opt
when '--difficulty'
case arg
when /^easy$/i
opts = OptionParser.new do |opts|
opts.banner = 'Metasploitable3 options:'
opts.on('-d', '--difficulty <String>', 'Level of difficulty') do |v|
if v =~ /^easy$/i
difficulty = :easy
end
end
end
opts.parse!(ARGV)
Vagrant.configure("2") do |config|
# Base configuration for the VM and provisioner
config.vm.box = "metasploitable3"