Skip to content

Commit

Permalink
Stop hiding tasks and list by first namespace.
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Jun 28, 2010
1 parent f81ae87 commit 88e3681
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/thor/runner.rb
Expand Up @@ -267,16 +267,11 @@ def display_klasses(with_modules=false, show_internal=false, klasses=Thor::Base.
raise Error, "No Thor tasks available" if klasses.empty?
show_modules if with_modules && !thor_yaml.empty?

# Remove subclasses
klasses.dup.each do |klass|
klasses -= Thor::Util.thor_classes_in(klass)
end

list = Hash.new { |h,k| h[k] = [] }
groups = klasses.select { |k| k.ancestors.include?(Thor::Group) }

# Get classes which inherit from Thor
(klasses - groups).each { |k| list[k.namespace] += k.printable_tasks(false) }
(klasses - groups).each { |k| list[k.namespace.split(":").first] += k.printable_tasks(false) }

# Get classes which inherit from Thor::Base
groups.map! { |k| k.printable_tasks(false).first }
Expand Down

0 comments on commit 88e3681

Please sign in to comment.