Class: Shoes::UI::CLI::HelpCommand

Inherits:
BaseCommand show all
Defined in:
shoes-core/lib/shoes/ui/cli/help_command.rb

Instance Attribute Summary

Attributes inherited from BaseCommand

#args

Instance Method Summary collapse

Methods inherited from BaseCommand

#help_from_options, #initialize, #parse!, #warn_on_unexpected_parameters

Constructor Details

This class inherits a constructor from Shoes::UI::CLI::BaseCommand

Instance Method Details

#helpObject



25
26
27
28
29
30
# File 'shoes-core/lib/shoes/ui/cli/help_command.rb', line 25

def help
  <<~EOS
    shoes help
        Displays this help text
EOS
end

#runObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'shoes-core/lib/shoes/ui/cli/help_command.rb', line 7

def run
  warn_on_unexpected_parameters

  puts "Shoes is the best little GUI toolkit for Ruby."
  puts

  command_classes = [DefaultCommand]
  command_classes.concat(SUPPORTED_COMMANDS.map(&:last))

  command_classes.each do |command_class|
    text = command_class.new([]).help.to_s
    unless text.empty?
      puts text
      puts
    end
  end
end