Sha256: 587a8af096fdec891719c303746d5d6f39d68b34eee99caec8f142e0b7398ab3

Contents?: true

Size: 704 Bytes

Versions: 12

Compression:

Stored size: 704 Bytes

Contents

module Brightbox
  command [:config] do |cmd|

    cmd.desc I18n.t("config.client_default.desc")
    cmd.arg_name "alias"
    cmd.command [:client_default] do |c|

      c.action do |_global_options, _options, args|

        info "Using config file #{$config.config_filename}"
        calias = args.shift

        if calias.nil?
          raise "You must specify the api alias you want to set as the default"
        end

        if $config.client_named?(calias)
          info "Setting #{calias} as default api client"
          $config.set_default_client(calias)
        else
          raise "An api client with the alias #{calias} does not exist in the config"
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
brightbox-cli-2.2.0 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-2.1.2 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-2.1.1 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-2.1.0 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-2.0.0 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-1.6.0 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-1.5.0 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-1.4.3 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-1.4.2 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-1.4.1 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-1.4.0 lib/brightbox-cli/commands/config/client-default.rb
brightbox-cli-1.3.0 lib/brightbox-cli/commands/config/client-default.rb