summaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/new.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2015-08-18 11:58:05 -0700
committerelijah <elijah@riseup.net>2015-08-18 11:58:05 -0700
commited604349a4035eed2bccefa9aa030d93ad4f6b58 (patch)
tree333a6c5335f25935be13c1ffed82b8cc7c293df8 /lib/leap_cli/commands/new.rb
parentcde4ae067e034e3969629f4d8da4f46daae3c351 (diff)
moved commands to leap_platform
Diffstat (limited to 'lib/leap_cli/commands/new.rb')
-rw-r--r--lib/leap_cli/commands/new.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/leap_cli/commands/new.rb b/lib/leap_cli/commands/new.rb
index 038e6e4..838b80e 100644
--- a/lib/leap_cli/commands/new.rb
+++ b/lib/leap_cli/commands/new.rb
@@ -4,7 +4,7 @@ module LeapCli; module Commands
desc 'Creates a new provider instance in the specified directory, creating it if necessary.'
arg_name 'DIRECTORY'
- skips_pre
+ #skips_pre
command :new do |c|
c.flag 'name', :desc => "The name of the provider." #, :default_value => 'Example'
c.flag 'domain', :desc => "The primary domain of the provider." #, :default_value => 'example.org'
@@ -12,6 +12,10 @@ module LeapCli; module Commands
c.flag 'contacts', :desc => "Default email address contacts." #, :default_value => 'root'
c.action do |global, options, args|
+ unless args.first
+ # this should not be needed, but GLI is not making it required.
+ bail! "Argument DIRECTORY is required."
+ end
directory = File.expand_path(args.first)
create_provider_directory(global, directory)
options[:domain] ||= ask_string("The primary domain of the provider: ") {|q| q.default = 'example.org'}