include Process
+$options = {}
+(ARGV.any? ? ARGV : ['--jobs', '--pipelines']).each do |arg|
+ case arg
+ when '--jobs'
+ $options[:jobs] = true
+ when '--pipelines'
+ $options[:pipelines] = true
+ else
+ abort "Unrecognized command line option '#{arg}'"
+ end
+end
+if not ($options[:jobs] or $options[:pipelines])
+ abort "Nothing to do. Please specify at least one of: --jobs, --pipelines."
+end
+
+ARGV.reject! { |a| a =~ /--jobs|--pipelines/ }
+
$warned = {}
$signal = {}
%w{TERM INT}.each do |sig|
end
def refresh_todo
- @todo = Job.queue.select do |j| j.repository end
- @todo_pipelines = PipelineInstance.queue
+ @todo = []
+ if $options[:jobs]
+ @todo = Job.queue.select(&:repository)
+ end
+ @todo_pipelines = []
+ if $options[:pipelines]
+ @todo_pipelines = PipelineInstance.queue
+ end
end
def sinfo