#!/usr/bin/env ruby # frozen_string_literal: true require 'bundler/setup' require 'cloudtasker/cli' require 'optparse' options = {} OptionParser.new do |opts| opts.banner = 'Usage: cloudtasker [options]' opts.on( '-q QUEUE', '--queue=QUEUE', 'Queue to process and number of threads. ' \ "Examples: '-q critical' | '-q critical,2' | '-q critical,3 -q defaults,2'" ) do |o| options[:queues] ||= [] options[:queues] << o.split(',') end end.parse! begin Cloudtasker::CLI.run(options) rescue StandardError => e raise e if $DEBUG warn e.message warn e.backtrace.join("\n") exit 1 end