refine decision to launch repl; option to set verbosity
Signed-off-by: Gwenhael Le Moine <gwenhael.le.moine@gmail.com>
This commit is contained in:
parent
e43eaff903
commit
291db997c5
1 changed files with 11 additions and 1 deletions
12
bin/rpl
12
bin/rpl
|
@ -85,7 +85,7 @@ def persistence_filename
|
|||
File.expand_path( "#{persistence_dir}/env.rpl" )
|
||||
end
|
||||
|
||||
options = { run_REPL: ARGV.empty?,
|
||||
options = { run_REPL: false,
|
||||
persistence: true,
|
||||
live_persistence: true,
|
||||
persistence_filename: persistence_filename,
|
||||
|
@ -128,8 +128,18 @@ OptionParser.new do |opts|
|
|||
|
||||
options[:run_REPL] = true
|
||||
end
|
||||
|
||||
opts.on('-V', '--verbose "level"', 'set verbosity level') do |level|
|
||||
options[:verbosity] = level.to_sym
|
||||
|
||||
warn "Setting verbosity to #{level.to_sym}" if options[:verbosity] == :debug
|
||||
end
|
||||
end.parse!
|
||||
|
||||
options[:run_REPL] = options[:files].empty? && options[:programs].empty?
|
||||
|
||||
warn "Loading state #{options[:persistence_filename]}." if options[:verbosity] == :debug && !options[:persistence_filename].nil?
|
||||
|
||||
# Instantiate interpreter
|
||||
interpreter = Rpl.new( persistence_filename: options[:persistence_filename],
|
||||
live_persistence: options[:live_persistence] )
|
||||
|
|
Loading…
Reference in a new issue