Sha256: 7ef0b504bdc684e1832e632a864b98fd68d577a5321cfa346c65e3abcac8fc3b

Contents?: true

Size: 609 Bytes

Versions: 12

Compression:

Stored size: 609 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Help < Command
      description "helps you out when in dire need of information"

      def run(command = nil)
        if command
          say CLI.command(command).new.help
        else
          say "Usage: travis COMMAND ...\n\nAvailable commands:\n\n"
          commands.each { |c| say "\t#{color(c.command_name, :command).ljust(22)} #{color(c.description, :info)}" }
          say "\nrun `#$0 help COMMAND` for more info"
        end
      end

      def commands
        CLI.commands.sort_by { |c| c.command_name }
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
travis-1.9.1.travis.1220.9 lib/travis/cli/help.rb
travis-1.9.1.travis.1219.9 lib/travis/cli/help.rb
travis-1.9.1.travis.1216.9 lib/travis/cli/help.rb
travis-1.9.1.travis.1208.9 lib/travis/cli/help.rb
travis-1.9.1.travis.1207.9 lib/travis/cli/help.rb
travis-1.9.1.travis.1206.9 lib/travis/cli/help.rb
travis-1.9.1.travis.1205.9 lib/travis/cli/help.rb
travis-1.9.0 lib/travis/cli/help.rb
travis-1.9.1.travis.1201.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1200.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1199.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1198.9 lib/travis/cli/help.rb