Class: Sunshine::StopCommand
- Inherits:
-
ListCommand
- Object
- DefaultCommand
- ListCommand
- Sunshine::StopCommand
- Defined in:
- lib/commands/stop.rb
Overview
Runs the stop script of all specified sunshine apps.
Usage: sunshine stop [options] app_name [more names…]
Arguments:
app_name Name of the application to stop.
Options:
-f, --format FORMAT Set the output format (txt, yml, json)
-u, --user USER User to use for remote login. Use with -r.
-r, --remote svr1,svr2 Run on one or more remote servers.
-S, --sudo Run remote commands using sudo or sudo -u USER
-v, --verbose Run in verbose mode.
Instance Attribute Summary
Attributes inherited from ListCommand
Class Method Summary collapse
-
.exec(names, config) ⇒ Object
Takes an array and a hash, runs the command and returns: true: success false: failed exitcode: code == 0: success code != 0: failed and optionally an accompanying message.
-
.parse_args(argv) ⇒ Object
Parses the argv passed to the command.
Instance Method Summary collapse
-
#stop(app_names) ⇒ Object
Stop specified apps.
Methods inherited from ListCommand
build_response, #details, #each_app, exec_each_server, #exist?, #initialize, json_format, load_list, #response_for_each, save_list, #status, #status_after_command, txt_format, yml_format
Methods inherited from DefaultCommand
build_response, copy_middleware, copy_rakefile, opt_parser, parse_remote_args
Constructor Details
This class inherits a constructor from Sunshine::ListCommand
Class Method Details
.exec(names, config) ⇒ Object
Takes an array and a hash, runs the command and returns:
true: success
false: failed
exitcode:
code == 0: success
code != 0: failed
and optionally an accompanying message.
29 30 31 32 33 34 35 |
# File 'lib/commands/stop.rb', line 29 def self.exec names, config output = exec_each_server config do |shell| new(shell).stop(names) end return output end |
.parse_args(argv) ⇒ Object
Parses the argv passed to the command
48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/commands/stop.rb', line 48 def self.parse_args argv parse_remote_args(argv) do |opt, | opt. = <<-EOF Usage: #{opt.program_name} stop [options] app_name [more names...] Arguments: app_name Name of the application to stop. EOF end end |
Instance Method Details
#stop(app_names) ⇒ Object
Stop specified apps.
41 42 43 |
# File 'lib/commands/stop.rb', line 41 def stop app_names status_after_command :stop, app_names, :sudo => false end |