# File lib/rhc/commands/domain.rb, line 30
    def update(namespace)
      # TODO: Support multiple domains.  Right now we assume one domain so
      #       you don't have to send in the name of the domain you want to change
      #       but in the future this will be manditory if you have more than one
      #       domain.  Figure out how to support overloading of commands
      domain = rest_client.domains
      raise RHC::DomainNotFoundException, "No domains are registered to the user #{config.username}. Please use 'rhc domain create' to create one." if domain.empty?

      say "Changing namespace '#{domain[0].id}' to '#{namespace}'..."

      domain[0].update(namespace)

      results do
        say "Success!"
        say "You can use 'rhc domain show' to view any url changes.  Be sure to update any links including the url in your local git config: <local_git_repo>/.git/config"
      end

      0
    end