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

Alphabetize CLI options

This commit is contained in:
Mike Perham 2013-01-31 13:39:21 -08:00
parent 7d922c690b
commit 89f76e076d

View file

@ -229,13 +229,8 @@ module Sidekiq
opts = {} opts = {}
@parser = OptionParser.new do |o| @parser = OptionParser.new do |o|
o.on "-q", "--queue QUEUE[,WEIGHT]...", "Queues to process with optional weights" do |arg| o.on '-c', '--concurrency INT', "processor threads to use" do |arg|
queues_and_weights = arg.scan(/([\w\.-]+),?(\d*)/) opts[:concurrency] = Integer(arg)
parse_queues opts, queues_and_weights
end
o.on "-v", "--verbose", "Print more verbose output" do |arg|
opts[:verbose] = arg
end end
o.on '-d', '--daemon', "Daemonize process" do |arg| o.on '-d', '--daemon', "Daemonize process" do |arg|
@ -246,18 +241,10 @@ module Sidekiq
opts[:environment] = arg opts[:environment] = arg
end end
o.on '-t', '--timeout NUM', "Shutdown timeout" do |arg|
opts[:timeout] = Integer(arg)
end
o.on '-g', '--tag TAG', "Process tag for procline" do |arg| o.on '-g', '--tag TAG', "Process tag for procline" do |arg|
opts[:tag] = arg opts[:tag] = arg
end end
o.on '-r', '--require [PATH|DIR]', "Location of Rails application with workers or file to require" do |arg|
opts[:require] = arg
end
o.on '-i', '--index INT', "unique process index on this machine" do |arg| o.on '-i', '--index INT', "unique process index on this machine" do |arg|
opts[:index] = Integer(arg) opts[:index] = Integer(arg)
end end
@ -266,12 +253,21 @@ module Sidekiq
opts[:profile] = arg opts[:profile] = arg
end end
o.on '-c', '--concurrency INT', "processor threads to use" do |arg| o.on "-q", "--queue QUEUE[,WEIGHT]...", "Queues to process with optional weights" do |arg|
opts[:concurrency] = Integer(arg) queues_and_weights = arg.scan(/([\w\.-]+),?(\d*)/)
parse_queues opts, queues_and_weights
end end
o.on '-P', '--pidfile PATH', "path to pidfile" do |arg| o.on '-r', '--require [PATH|DIR]', "Location of Rails application with workers or file to require" do |arg|
opts[:pidfile] = arg opts[:require] = arg
end
o.on '-t', '--timeout NUM', "Shutdown timeout" do |arg|
opts[:timeout] = Integer(arg)
end
o.on "-v", "--verbose", "Print more verbose output" do |arg|
opts[:verbose] = arg
end end
o.on '-C', '--config PATH', "path to YAML config file" do |arg| o.on '-C', '--config PATH', "path to YAML config file" do |arg|
@ -282,6 +278,10 @@ module Sidekiq
opts[:logfile] = arg opts[:logfile] = arg
end end
o.on '-P', '--pidfile PATH', "path to pidfile" do |arg|
opts[:pidfile] = arg
end
o.on '-V', '--version', "Print version and exit" do |arg| o.on '-V', '--version', "Print version and exit" do |arg|
puts "Sidekiq #{Sidekiq::VERSION}" puts "Sidekiq #{Sidekiq::VERSION}"
die(0) die(0)