Sha256: 9b63722ec657b19db3d1b29ecf510c38a915581b81f31332068cdadd615b9dfa

Contents?: true

Size: 549 Bytes

Versions: 18

Compression:

Stored size: 549 Bytes

Contents

module Brightbox
  command [:accounts] do |cmd|
    cmd.desc I18n.t("accounts.default.desc")
    cmd.arg_name "account-id"
    cmd.command [:default] do |c|
      c.action do |_global_options, _options, args|
        if args.empty?
          raise "You must specify the account-id to set as default."
        end

        account_id = args.shift
        account = Account.find(account_id)

        unless account
          raise "Invalid account-id"
        end

        Brightbox.config.save_default_account(account_id)
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
brightbox-cli-5.0.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-5.0.0.rc2 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-5.0.0.rc1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-5.0.0.alpha lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.8.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.7.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.6.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.5.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.5.0.rc1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.4.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.3.2 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.3.1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.3.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.2.1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.2.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.1.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.0.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-4.0.0.rc2 lib/brightbox-cli/commands/accounts/default.rb