bin/rivet in rivet-2.0.0 vs bin/rivet in rivet-3.0.0
- old
+ new
@@ -7,46 +7,51 @@
DEBUG = Logger::DEBUG
WARN = Logger::WARN
FATAL = Logger::FATAL
INFO = Logger::INFO
+client_type = ARGV[0]
+
+unless ["ec2","autoscale","-h"].include? client_type
+ Rivet::Utils.die "You must select either 'ec2' or 'autoscale' your first argument"
+end
+
# Default option values
options = OpenStruct.new
options.log_level = INFO
options.profile = 'default'
-options.config_path = File.join('.', 'autoscale')
+options.config_path = File.join('.', client_type)
OptionParser.new do |o|
- o.on('-g', '--group [GROUP_NAME]', String, 'Autoscaling group name') do |g|
- options.group = g
- end
-
o.on('-l', '--log-level [LEVEL]', String, 'specify the log level (default is INFO)') do |l|
options.log_level = Kernel.const_get l.upcase
end
-
o.on('-p', '--profile [PROFILE_NAME]', 'Selects the AWS profile to use (default is "default")') do |p|
options.profile = p
end
o.on('-s', '--sync', 'Sync the changes remotely to AWS') do |s|
options.sync = s
end
- o.on('-c', '--config-path [PATH]', 'The configuration path to use (default is ./autoscale)') do |c|
+ o.on('-c', '--config-path [PATH]', 'The configuration path to use (default is ./autoscale or ./ec2)') do |c|
options.config_path = c
end
- o.on('-h') { Rivet::Log.info o; exit }
+ o.on('-n', '--name [NAME]', String, 'Server or Autoscaling group name') do |n|
+ options.name = n
+ end
+ o.on('-h') { Rivet::Log.info o; exit 0 }
+
begin
o.parse!
rescue OptionParser::InvalidOption, OptionParser::MissingArgument
Rivet::Log.fatal $!.to_s
Rivet::Log.fatal o
exit 255
end
end
-Rivet::Client.new.run(options)
+Rivet::Client.new.run(client_type,options)