Sha256: d33e24ec5a2dce645b12a9a08944ce01141663cb07eaca2e220966eabe0978fb

Contents?: true

Size: 610 Bytes

Versions: 187

Compression:

Stored size: 610 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 infos"
        end
      end

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

Version data entries

187 entries across 187 versions & 3 rubygems

Version Path
travis-1.8.14.travis.1197.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1195.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1192.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1186.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1184.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1183.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1178.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1175.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1172.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1164.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1163.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1162.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1160.9 lib/travis/cli/help.rb
travis-1.8.13 lib/travis/cli/help.rb
travis-1.8.14.travis.1156.9 lib/travis/cli/help.rb
travis-1.8.14.travis.1155.9 lib/travis/cli/help.rb
travis-1.8.13.travis.1152.9 lib/travis/cli/help.rb
travis-1.8.13.travis.1148.9 lib/travis/cli/help.rb
travis-1.8.12 lib/travis/cli/help.rb
travis-1.8.13.travis.1141.9 lib/travis/cli/help.rb