allow --help CLI option with no Rsconscript present - close #106

This commit is contained in:
Josh Holtrop 2019-05-19 12:13:03 -04:00
parent bfcd0c0b05
commit ef2a9084db

View File

@ -121,21 +121,24 @@ module Rscons
rsconscript = DEFAULT_RSCONSCRIPTS.find do |f| rsconscript = DEFAULT_RSCONSCRIPTS.find do |f|
File.exists?(f) File.exists?(f)
end end
unless rsconscript
$stderr.puts "Could not find the Rsconscript to execute."
$stderr.puts "Looked for: #{DEFAULT_RSCONSCRIPTS.join(", ")}"
exit 1
end
end end
if rsconscript
script = Script.new script = Script.new
script.load(rsconscript) script.load(rsconscript)
end
if do_help if do_help
puts USAGE puts USAGE
exit 0 exit 0
end end
unless rsconscript
$stderr.puts "Could not find the Rsconscript to execute."
$stderr.puts "Looked for: #{DEFAULT_RSCONSCRIPTS.join(", ")}"
exit 1
end
operation_options = parse_operation_args(operation, argv) || {} operation_options = parse_operation_args(operation, argv) || {}
exit Rscons.application.run(operation, script, operation_options) exit Rscons.application.run(operation, script, operation_options)