Class: EYCli::Command::CreateApp::AppParser

Inherits:
Object
  • Object
show all
Defined in:
lib/ey_cli/commands/create_app.rb

Instance Method Summary collapse

Instance Method Details

#parse(args) ⇒ Object



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/ey_cli/commands/create_app.rb', line 60

def parse(args)
  opts = Slop.parse(args, {:multiple_switches => false}) do
    on :account, true
    on :name, true
    on :git, true
    on :type, true
    on :env_name, true
    on :framework_env, true
    on :url, true
    on :app_instances, true, :as => :integer
    on :db_instances, true, :as => :integer
    #on :util_instances, true, :as => :integer # FIXME: utils instances are handled differently
    on :solo, false, :default => false
    on :stack, true, :matches => /passenger|unicorn|puma|thin|trinidad/
    on :db_stack, true, :matches => /mysql|postgres/
    on :no_env, false, :default => false
    on :app_size, true do |size|
      CreateEnv::EnvParser.check_instance_size(size)
    end
    on :db_size, true do |size|
      CreateEnv::EnvParser.check_instance_size(size)
    end
  end
  opts.to_hash
end