class Moonshot::SSHCommand

A SSHCommand that is automatically registered with the Moonshot::CommandLine, including options for SSH access.

Public Instance Methods

parser() click to toggle source
Calls superclass method Moonshot::Command#parser
# File lib/moonshot/ssh_command.rb, line 7
def parser
  parser = super
  parser.on('-l', '--user USER', 'User to log into remote machine as') do |v|
    Moonshot.config.ssh_config.ssh_user = v
  end

  parser.on('-i', '--identity-file FILE', 'SSH Private Key to authenticate with') do |v|
    Moonshot.config.ssh_config.ssh_identity_file = v
  end

  parser.on('-s', '--instance INSTANCE_ID', 'Specific AWS EC2 ID to connect through') do |v|
    Moonshot.config.ssh_instance = v
  end

  parser.on('-c', '--command COMMAND', 'Command to execute on the remote host') do |v|
    Moonshot.config.ssh_command = v
  end

  parser.on('-g', '--auto-scaling-group ASG_NAME',
            'The logical ID of the ASG to SSH into, required for multiple stacks') do |v|
    Moonshot.config.ssh_auto_scaling_group_name = v
  end
end