Add Enum-type options for external modules

4.x
Adam Cammack 2018-02-02 14:40:04 -06:00 committed by Pearce Barry
parent 0fe2fb9186
commit b0da7fcd26
1 changed files with 7 additions and 2 deletions

View File

@ -45,8 +45,13 @@ class Msf::Modules::External::Shim
end
meta[:options] = options.map do |n, o|
"Opt#{o['type'].camelize}.new(#{n.dump},
[#{o['required']}, #{o['description'].dump}, #{o['default'].inspect}])"
if o['values']
"Opt#{o['type'].camelize}.new(#{n.dump},
[#{o['required']}, #{o['description'].dump}, #{o['default'].inspect}, #{o['values'].inspect}])"
else
"Opt#{o['type'].camelize}.new(#{n.dump},
[#{o['required']}, #{o['description'].dump}, #{o['default'].inspect}])"
end
end.join(",\n ")
meta
end