vmc-ng/lib/vmc/cli/domain.rb in vmc-0.4.0.beta.76 vs vmc-ng/lib/vmc/cli/domain.rb in vmc-0.4.0.beta.77
- old
+ new
@@ -22,14 +22,13 @@
end
line unless quiet?
table(
- %w{name wildcard? owner},
+ %w{name owner},
domains.sort_by(&:name).collect { |r|
[ c(r.name, :name),
- c(r.wildcard, r.wildcard ? :yes : :no),
if org = r.owning_organization
c(org.name, :name)
else
d("none")
end
@@ -85,33 +84,26 @@
desc "Create a domain"
group :domains
input :name, :argument => :required,
- :desc => "Domain name to create (*.foo.com for wildcard)"
+ :desc => "Domain name to create"
input :organization, :aliases => ["--org", "-o"],
:from_given => by_name("organization"),
:default => proc { client.current_organization },
:desc => "Organization to add the domain to"
+ input :shared, :type => :boolean, :default => false,
+ :desc => "Create a shared domain (admin-only)"
def create_domain
org = input[:organization]
- name = input[:name]
- wildcard = false
+ name = input[:name].sub(/^\*\./, "")
- # *.foo.com for wildcard
- if name =~ /^\*\.(.+)$/
- name = $1
- wildcard = true
- end
-
domain = client.domain
domain.name = name
- domain.wildcard = wildcard
- domain.owning_organization = org
+ domain.owning_organization = org unless input[:shared]
with_progress("Creating domain #{c(name, :name)}") do
domain.create!
- org.add_domain(domain) if org
end
end
desc "Add a domain to a space"