bin/create_driver.rb in rpipe-0.1.3 vs bin/create_driver.rb in rpipe-0.1.4

- old
+ new

@@ -14,19 +14,25 @@ workflow_options_defaults = {} workflow_options = workflow_options_defaults.merge(spec_options).merge(cli_options[:config]) # Create a Workflow Generator and use it to create configure job. - rawdir = ARGV.pop - workflow = WorkflowGenerator.new(rawdir, workflow_options) - if cli_options[:dry_run] - pp workflow.build - else + while ARGV.size >= 1 begin - puts write_driver_hash workflow.build, :cli_options => cli_options - rescue IOError => e - puts e + rawdir = ARGV.shift + workflow = WorkflowGenerator.new(rawdir, workflow_options) + if cli_options[:dry_run] + pp workflow.build + else + begin + puts write_driver_hash workflow.build, :cli_options => cli_options + rescue IOError => e + puts e + end + end + rescue StandardError => e + puts "Problem creating driver for #{rawdir}" end end end def write_driver_hash (workflow_spec, driver_options = {:filename => nil}) @@ -56,11 +62,11 @@ end def parse_options options = { :config => {} } parser = OptionParser.new do |opts| - opts.banner = "Usage: #{File.basename(__FILE__)} [options] RAWDIR" + opts.banner = "Usage: #{File.basename(__FILE__)} [options] RAWDIR(S)" opts.on('-s', '--spec SPEC', "Spec File for common study parameters") do |spec_file| options[:spec_file] = spec_file end @@ -76,9 +82,10 @@ options[:force] = true end opts.on_tail('-h', '--help', "Show this message") { puts(parser); exit } opts.on_tail("Example: #{File.basename(__FILE__)} mrt00001") + opts.on_tail("Example: #{File.basename(__FILE__)} raw/johnson.merit220.visit1/mri/mrt*") end parser.parse!(ARGV) if ARGV.size == 0 puts "Problem with arguments - Missing RAWDIR"