Sha256: fcc71da87241317da811e24e0f9d61baec5a7c2385ed25d00293b3e97256caef
Contents?: true
Size: 1.09 KB
Versions: 25
Compression:
Stored size: 1.09 KB
Contents
require "shelly/cli/command" module Shelly module CLI class Organization < Command namespace :organization include Helpers before_hook :logged_in?, :only => [:list, :add] desc "list", "Lists organizations" def list user = Shelly::User.new organizations = user.organizations say "You have access to the following organizations and clouds:", :green say_new_line organizations.each do |organization| say organization.name, :green if organization.apps.present? print_table(apps_table(organization.apps), :ident => 2, :colwidth => 35) else print_wrapped "No clouds", :ident => 2 end end end method_option "redeem-code", :type => :string, :aliases => "-r", :desc => "Redeem code for free credits" desc "add", "Add a new organization" def add create_new_organization(options) rescue Client::ValidationException => e e.each_error { |error| say_error error, :with_exit => false } exit 1 end end end end
Version data entries
25 entries across 25 versions & 1 rubygems