Method: Jets::Commands::Base.help_list

Defined in:
lib/jets/commands/base.rb

.help_list(all = false) ⇒ Object



84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/jets/commands/base.rb', line 84

def help_list(all=false)
  # hack to show hidden comands when requested
  Thor::HiddenCommand.class_eval do
    def hidden?; false; end
  end if all

  list = []
  eager_load!
  subclasses.each do |klass|
    commands = klass.printable_commands(true, false)
    commands.reject! { |array| array[0].include?(':help') }
    list += commands
  end

  list.sort_by! { |array| array[0] }
end