You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
522 B
28 lines
522 B
require "option_parser"
|
|
require "colorize"
|
|
require "./src/specparser"
|
|
|
|
recipe_file_name = "some-non-existant-file"
|
|
|
|
OptionParser.parse do |parser|
|
|
parser.on "-f file", "--file file", "File to parse." do |f|
|
|
recipe_file_name = f
|
|
end
|
|
|
|
parser.on "-h", "--help", "Show this help" do
|
|
puts parser
|
|
exit 0
|
|
end
|
|
end
|
|
|
|
|
|
options = Hash(String,String).new
|
|
options["someoptionexample"] = "option"
|
|
|
|
begin
|
|
specs = SpecParser.parse_file recipe_file_name, options
|
|
pp! specs
|
|
rescue e
|
|
STDERR.puts "#{e}".colorize(:red).bright
|
|
end
|