Skip to content

Instantly share code, notes, and snippets.

@shadoi
Created February 7, 2012 04:31
Show Gist options
  • Save shadoi/1757187 to your computer and use it in GitHub Desktop.
Save shadoi/1757187 to your computer and use it in GitHub Desktop.
params = {}
security_group = {}
opt_parser = OptionParser.new do |opts|
opts.on("-c", "=CLASS", "") {|val| classes.push(val)}
opts.on("-p", /[a-zA-Z0-9_-]+=.*/,"=PARAMETER=VALUE",
"Set puppet variable PARAMETER to VALUE") do |val|
a = val.split('=',2)
params[a[0]] = a[1]
end
opts.on("-g", /[a-zA-Z0-9_-]+=.*/,"=SECURITY-GROUP", "Use SECURITY-GROUP (default default)") do |val|
a = val.split('=',2)
security_group[a[0]] = a[1]
end
end
opt_parser.parse!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment