Sha256: 8bd86e32a16a617ba27c64da126452d8e913cce73affa487594b3a18e9bec1f0

Contents?: true

Size: 714 Bytes

Versions: 1

Compression:

Stored size: 714 Bytes

Contents

# frozen_string_literal: true

class Shoes
  module UI
    class CLI
      class HelpCommand < BaseCommand
        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

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shoes-core-4.0.0.rc1 lib/shoes/ui/cli/help_command.rb