Skip to content

Commit

Permalink
Moved global options to bottom of task listing
Browse files Browse the repository at this point in the history
  • Loading branch information
fabien committed Oct 11, 2008
1 parent 34682ae commit b0ccd90
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/thor/runner.rb
Expand Up @@ -227,15 +227,16 @@ def display_tasks(klass, max_base, max_left)
puts "\033[1;34m#{base}\033[0m"
puts "-" * base.length

unless klass.opts.empty?
puts "global options: #{Options.new(klass.opts)}\n\n"
end

klass.tasks.each true do |name, task|
format_string = "%-#{max_left + max_base + 5}s"
print format_string % task.formatted_usage(true)
puts task.description
end

unless klass.opts.empty?
puts "\nglobal options: #{Options.new(klass.opts)}"
end

puts # add some spacing
end
end
Expand Down

0 comments on commit b0ccd90

Please sign in to comment.