Sha256: 83cd6b18d1b17eb0824dc594c537f4a563d2bf5750e0589e18061245de4c0769

Contents?: true

Size: 842 Bytes

Versions: 2

Compression:

Stored size: 842 Bytes

Contents

require 'cl'

module Heroku
  module Apps
    class Create < Cl::Cmd
      register 'apps:create'

      arg :name, required: true

      opt '-o', '--org ORG' do |value|
        opts[:org] = value
      end

      def run; [registry_key, args, opts] end
    end

    class List < Cl::Cmd
      register 'apps:info'

      opt '-a', '--app APP' do |value|
        opts[:app] = value
      end

      def run; [registry_key, args, opts] end
    end
  end
end

def output(cmd, args, opts)
  puts "Called #{cmd} with args=#{args} opts=#{opts}"
end

output *Cl.run(*%w(apps:create name -o org))
# Called apps:create with args=["name"] opts={:org=>"org"}

output *Cl.run(*%w(apps create name -o org))
# Called apps:create with args=["name"] opts={:org=>"org"}

output *Cl.run(*%w(apps:info -a app))
# Called apps:create with args=["app"] opts={}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cl-0.0.4 examples/heroku.rb
cl-0.0.3 examples/heroku.rb