Sha256: c24351adebf5d9bc91e80b4464b1cdcb03f99b7529f173529aa2103653d9df8c

Contents?: true

Size: 513 Bytes

Versions: 6

Compression:

Stored size: 513 Bytes

Contents

# -*- encoding : utf-8 -*-

class Phrase::Tool::Commands::ShowHelp < Phrase::Tool::Commands::Base
  def initialize(options, args)
    super(options, args)
  end

  def execute!
    show_help
  end

private

  def show_help
    msg = "usage: phrase <command> [<args>]\n"
    Phrase::Tool::Commands.possible_commands.each do |command, suffix| 
      msg << "    #{extract_help(command)}\n"
    end

    print_message msg
  end

  def extract_help(command)
    OptionsFactory.options_for(command, {}).help
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
phrase-0.4.14 lib/phrase/tool/commands/show_help.rb
phrase-0.4.13 lib/phrase/tool/commands/show_help.rb
phrase-0.4.12 lib/phrase/tool/commands/show_help.rb
phrase-0.4.11 lib/phrase/tool/commands/show_help.rb
phrase-0.4.10 lib/phrase/tool/commands/show_help.rb
phrase-0.4.9 lib/phrase/tool/commands/show_help.rb