cmd/run.rb in bahuvrihi-tap-0.10.1 vs cmd/run.rb in bahuvrihi-tap-0.10.2
- old
+ new
@@ -5,18 +5,18 @@
# tap run -- task --help Prints help for task
#
env = Tap::Env.instance
app = Tap::App.instance
-cmdline = Tap::Support::CommandLine
#
# handle options
#
dump = false
OptionParser.new do |opts|
+ cmdline = Tap::Support::CommandLine
opts.separator ""
opts.separator "configurations:"
Tap::App.configurations.each do |receiver, key, config|
@@ -46,33 +46,12 @@
#
# handle options for each specified task
#
-rounds = cmdline.split(ARGV).collect do |argvs|
- argvs.each do |argv|
- ARGV.clear
- ARGV.concat(argv)
-
- unless td = cmdline.shift(ARGV)
- # warn nil?
- next
- end
-
- # attempt lookup the task class
- const = env.search(:tasks, td) or raise "unknown task: #{td}"
- task_class = const.constantize or raise "unknown task: #{td}"
-
- # now let the class handle the argv
- task, argv = task_class.instantiate(ARGV, app)
- task.enq *argv.collect! {|str| cmdline.parse_yaml(str) }
- end
-
- app.queue.clear
-end
+rounds = env.parse(ARGV)
ARGV.clear
-rounds.delete_if {|round| round.empty? }
if rounds.empty?
puts "no task specified"
exit
end