Sha256: 513b306a05720c4e7b5b051106c926f845df9d53ec3c6084eafdb4ab8c8191b5

Contents?: true

Size: 550 Bytes

Versions: 28

Compression:

Stored size: 550 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

28 entries across 28 versions & 1 rubygems

Version Path
brightbox-cli-3.3.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-3.2.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-3.1.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-3.0.1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-3.0.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.12.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.11.2 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.11.1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.11.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.10.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.9.3 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.9.2 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.9.1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.9.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.8.2 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.8.1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.8.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.7.1 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.7.0 lib/brightbox-cli/commands/accounts/default.rb
brightbox-cli-2.6.0 lib/brightbox-cli/commands/accounts/default.rb