#!/usr/bin/env ruby # frozen_string_literal: true require_relative '../lib/quiq' require 'optparse' options = {} OptionParser.new do |opts| opts.banner = 'Usage: quiq [options]' opts.on('-p', '--path [PATH|DIR]", "Location of the workers to require') do |path| options[:path] = path end opts.on('-q', '--queues [NAMES]", "Comma-separated list of queues to fetch jobs from') do |queues| options[:queues] = queues.split(',') end opts.on '-v', '--version', 'Output version and exit' do |arg| puts "Quiq #{Quiq::VERSION}" exit end opts.on_tail('-h', '--help', 'Show this message') do puts opts exit end end.parse! begin Quiq.run(options) rescue warn $!.message warn $!.backtrace.join("\n") exit 1 end