lib/scout/command.rb in scout-5.5.10 vs lib/scout/command.rb in scout-5.6.0.alpha
- old
+ new
@@ -28,12 +28,12 @@
opts.banner = "Usage:"
opts.separator "--------------------------------------------------------------------------"
opts.separator " Normal checkin with server:"
opts.separator " #{program_name} [OPTIONS] CLIENT_KEY"
- opts.separator " ... OR ..."
- opts.separator " #{program_name} [OPTIONS] run CLIENT_KEY"
+ opts.separator " ... or, specifying roles:"
+ opts.separator " #{program_name} --roles app,db [ADDITIONAL OPTIONS] CLIENT_KEY"
opts.separator " Install:"
opts.separator " #{program_name}"
opts.separator " ... OR ..."
opts.separator " #{program_name} [OPTIONS] install"
opts.separator " Troubleshoot:"
@@ -50,10 +50,16 @@
opts.separator "Note: This client is meant to be installed and"
opts.separator "invoked through cron or any other scheduler."
opts.separator " "
opts.separator "Specific Options:"
opts.separator "--------------------------------------------------------------------------"
+ opts.on( "-r", "--roles role1,role2", String,
+ "Roles for this server. Roles are defined through scoutapp.com's web UI" ) do |roles|
+ options[:roles] = roles
+ end
+
+
opts.on( "-s", "--server SERVER", String,
"The URL for the server to report to." ) do |url|
options[:server] = url
end
@@ -153,9 +159,10 @@
end
command.run
end
def initialize(options, args)
+ @roles = options[:roles]
@server = options[:server] || "https://scoutapp.com/"
@history = options[:history] ||
File.join( File.join( (File.expand_path("~") rescue "/"),
".scout" ),
"client_history.yaml" )