Sha256: 70b3454d0a2f9c9ac0170de2fbcf3e467b1219dcf1e9b033a50ebd2c0555e86b
Contents?: true
Size: 1.16 KB
Versions: 25
Compression:
Stored size: 1.16 KB
Contents
require "shelly/cli/command" module Shelly module CLI class Organization < Command namespace :organization include Helpers before_hook :logged_in?, :only => [:list, :add, :create, :new] 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" map "create" => :add map "new" => :add 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