lib/opal/cli_options.rb in opal-0.10.6 vs lib/opal/cli_options.rb in opal-0.11.0.rc1
- old
+ new
@@ -1,5 +1,6 @@
+# frozen_string_literal: true
require 'optparse'
module Opal
class CLIOptions < OptionParser
def initialize
@@ -74,14 +75,10 @@
on('--sexp', 'Show Sexps') do
options[:sexp] = true
end
- on('-m', '--map', 'Show sourcemap') do
- options[:map] = true
- end
-
on('-c', '--compile', 'Compile to JavaScript') do
options[:compile] = true
end
on('-R', '--runner RUNNER', %w[nodejs server phantomjs applescript nashorn], 'Choose the runner: nodejs (default), server') do |runner|
@@ -120,13 +117,12 @@
'Set level of dynamic require severity.',
"(default: error, values: #{dynamic_require_levels.join(', ')})") do |level|
options[:dynamic_require_severity] = level.to_sym
end
- on('-P', '--source-map [FILE]', 'Enable/Disable source map') do |file|
- options[:source_map_enabled] = true
- options[:source_map_file] = file if file
+ on('-P', '--map FILE', 'Enable/Disable source map') do |file|
+ options[:map] = file
end
on('-F', '--file FILE', 'Set filename for compiled code') do |file|
options[:file] = file
end
@@ -138,9 +134,17 @@
options[:skip_opal_require] = true
end
on("--irb", "Enable IRB var mode") do
options[:irb] = true
+ end
+
+ on('--enable-source-location', 'Compiles source location for each method definition.') do
+ options[:enable_source_location] = true
+ end
+
+ on('--parse-comments', 'Compiles comments for each method definition.') do
+ options[:parse_comments] = true
end
separator ''
end