bin/roku in roku_builder-3.8.5 vs bin/roku in roku_builder-3.9.0

- old
+ new

@@ -10,11 +10,16 @@ options = {} options[:config] = '~/.roku_config.json' options[:update_manifest] = false -OptionParser.new do |opts| +logger = Logger.new(STDOUT) +logger.formatter = proc {|severity, datetime, _progname, msg| + "[%s #%s] %5s: %s\n\r" % [datetime.strftime("%Y-%m-%d %H:%M:%S.%4N"), $$, severity, msg] +} + +parser = OptionParser.new do |opts| opts.banner = "Usage: roku <command> [options]" opts.on("-l", "--sideload", "Command: Sideload an app") do options[:sideload] = true end @@ -73,15 +78,15 @@ opts.on("--profile COMMAND", "Command: Run various profiler options") do |c| options[:profile] = c end - opts.on("--do-stage", "Command: Run the stager. Used for scripting. Alwasy run --do-unscript after") do + opts.on("--do-stage", "Command: Run the stager. Used for scripting. Always run --do-unscript after") do options[:dostage] = true end - opts.on("--do-unstage", "Command: Run the unstager. Used for scripting. Alwasy run --do-script first") do + opts.on("--do-unstage", "Command: Run the unstager. Used for scripting. Always run --do-script first") do options[:dounstage] = true end opts.on("--screen SCREEN", "Command: show a screen") do |s| options[:screen] = s @@ -176,8 +181,14 @@ opts.on("-v", "--version", "Show version") do puts RokuBuilder::VERSION exit end -end.parse! +end -RokuBuilder::Controller.run(options: options) +begin + parser.parse! + RokuBuilder::Controller.run(options: options, logger: logger) +rescue OptionParser::ParseError => e + logger.fatal e.message +end +