Sha256: c52198bd22fde8a1a3c0ef9d3c4536823bdd8880770ec64d18d96c2d2f1fa11a

Contents?: true

Size: 481 Bytes

Versions: 23

Compression:

Stored size: 481 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Help < Command
      def run(command = nil)
        if command
          say CLI.command(command).new.help
        else
          say "Usage: #$0 COMMAND ...\n\nAvailable commands:\n\n"
          commands.each { |c| say "\t#{c.command_name}" }
          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

23 entries across 23 versions & 1 rubygems

Version Path
travis-1.5.2 lib/travis/cli/help.rb
travis-1.5.1 lib/travis/cli/help.rb
travis-1.5.0 lib/travis/cli/help.rb
travis-1.4.0 lib/travis/cli/help.rb
travis-1.3.1 lib/travis/cli/help.rb
travis-1.3.0 lib/travis/cli/help.rb
travis-1.2.8 lib/travis/cli/help.rb
travis-1.2.7 lib/travis/cli/help.rb
travis-1.2.6 lib/travis/cli/help.rb
travis-1.2.5 lib/travis/cli/help.rb
travis-1.2.4 lib/travis/cli/help.rb
travis-1.2.3 lib/travis/cli/help.rb
travis-1.2.2 lib/travis/cli/help.rb
travis-1.2.1 lib/travis/cli/help.rb
travis-1.2.0 lib/travis/cli/help.rb
travis-1.1.3 lib/travis/cli/help.rb
travis-1.1.2 lib/travis/cli/help.rb
travis-1.1.1 lib/travis/cli/help.rb
travis-1.1.0 lib/travis/cli/help.rb
travis-1.0.3 lib/travis/cli/help.rb