Sha256: 6544c97d7ce29d80cc10cd00de0158e5a5556ab7a2725b12f058348df34ee13a

Contents?: true

Size: 1.04 KB

Versions: 6

Compression:

Stored size: 1.04 KB

Contents

# tap run {options} -- {task options} task INPUTS...
#
# examples:
#   tap run --help                     Prints this help
#   tap run -- task --help             Prints help for task
#

env = Tap::Env.instance
app = Tap::App.instance

#
# handle options
#

dump = false
OptionParser.new do |opts|
  opts.separator ""
  opts.separator "configurations:"
  
  Tap::App.configurations.each do |receiver, key, config|
    next if receiver == Tap::Root
    
    opts.on(*config.to_optparse_argv) do |value|
      app.send(config.writer, value)
    end
  end
 
  opts.separator ""
  opts.separator "options:"

  opts.on("-h", "--help", "Show this message") do
    opts.banner = Tap::Support::Lazydoc.usage(__FILE__)
    Tap::App.lazydoc.resolve
    puts opts
    exit
  end
  
  opts.on('-T', '--manifest', 'Print a list of available tasks') do |v|
    puts env.summarize(:tasks)
    exit
  end
  
end.parse!(ARGV)

#
# build and run the argv
#

queues = env.build(ARGV)
ARGV.clear

if queues.empty?
  puts "no task specified"
  exit
end

env.set_signals
env.run(queues)

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
bahuvrihi-tap-0.10.8 cmd/run.rb
bahuvrihi-tap-0.11.0 cmd/run.rb
bahuvrihi-tap-0.11.1 cmd/run.rb
bahuvrihi-tap-0.11.2 cmd/run.rb
tap-0.11.1 cmd/run.rb
tap-0.11.0 cmd/run.rb