lib/meroku/options.rb in meroku-2.0.27 vs lib/meroku/options.rb in meroku-2.0.28
- old
+ new
@@ -20,10 +20,11 @@
opts.on('--help', 'Prints this help') { puts opts }
add_user_options(opts)
add_key_options(opts)
add_app_options(opts)
opts.separator ''
+ add_maintainer_spawn_options(opts)
add_maintainer_options(opts)
end
end
def add_key_options(opts)
@@ -74,21 +75,28 @@
option(opts, '--logout') do
@options[:logout] = true
end
end
- def add_maintainer_options(opts)
+ def add_maintainer_spawn_options(opts)
option(opts, '--spawn MEROKU_SECRET') do |meroku_secret|
@options[:spawn] = true
@options[:meroku_secret] = meroku_secret
end
option(opts, '--despawn MEROKU_SECRET') do |meroku_secret|
@options[:despawn] = true
@options[:meroku_secret] = meroku_secret
end
end
+ def add_maintainer_options(opts)
+ option(opts, '--backup MEROKU_SECRET') do |meroku_secret|
+ @options[:backup] = true
+ @options[:meroku_secret] = meroku_secret
+ end
+ end
+
# Sets a value in the @options hash, based on the given long option and its
# value, in addition to calling the block if a block is given.
def option(opts, *args)
long_opt_symbol = long_opt_symbol(args)
args += Array(OptionsHelp::TEXT[long_opt_symbol])
@@ -110,9 +118,10 @@
module OptionsHelp
TEXT = {
version: 'Display version.',
spawn: 'Spawn infrastructure',
keys: 'List already uploaded keys',
- create: 'Create an app'
+ create: 'Create an app',
+ backup: 'Take a backup, before despawing'
}.freeze
end
end