def optspec(string, config = {})
warn "[DEPRECATED] `Slop.optspec` is deprecated and will be removed in version 4"
config[:banner], optspec = string.split(/^--+$/, 2) if string[/^--+$/]
lines = optspec.split("\n").reject(&:empty?)
opts = Slop.new(config)
lines.each do |line|
opt, description = line.split(' ', 2)
short, long = opt.split(',').map { |s| s.sub(/\A--?/, '') }
opt = opts.on(short, long, description)
if long && long.end_with?('=')
long.sub!(/\=$/, '')
opt.config[:argument] = true
end
end
opts
end