1
0
Fork 0
mirror of https://github.com/mperham/sidekiq.git synced 2022-11-09 13:52:34 -05:00

Support queue-names-with-dashes

This commit is contained in:
John Firebaugh 2012-08-15 11:46:43 -07:00
parent 6ebd1405ff
commit 2db50b479a
2 changed files with 6 additions and 1 deletions

View file

@ -141,7 +141,7 @@ module Sidekiq
@parser = OptionParser.new do |o|
o.on "-q", "--queue QUEUE[,WEIGHT]...", "Queues to process with optional weights" do |arg|
queues_and_weights = arg.scan(/(\w+),?(\d*)/)
queues_and_weights = arg.scan(/([\w-]+),?(\d*)/)
queues_and_weights.each {|queue_and_weight| parse_queues(opts, *queue_and_weight)}
opts[:strict] = queues_and_weights.collect(&:last).none? {|weight| weight != ''}
end

View file

@ -65,6 +65,11 @@ class TestCli < MiniTest::Unit::TestCase
assert_equal %w(bar foo foo foo), Sidekiq.options[:queues]
end
it 'handles queues with multi-word names' do
@cli.parse(['sidekiq', '-q', 'queue_one,queue-two', '-r', './test/fake_env.rb'])
assert_equal %w(queue_one queue-two), Sidekiq.options[:queues]
end
it 'sets verbose' do
old = Sidekiq.logger.level
@cli.parse(['sidekiq', '-v', '-r', './test/fake_env.rb'])