Class: VagrantPlugins::CommandInfo::Command

Inherits:
Object
  • Object
show all
Includes:
Vagrant::Util::SafePuts
Defined in:
lib/vagrant-info/infossh_command.rb,
lib/vagrant-info/infoindex_command.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.synopsisObject



11
12
13
# File 'lib/vagrant-info/infossh_command.rb', line 11

def self.synopsis
  "Ouput the ssh configuration of a vagrant box."
end

Instance Method Details

#executeObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vagrant-info/infossh_command.rb', line 15

def execute
  opts = OptionParser.new do |o|
    o.banner = "Usage: vagrant sshinfo [name]"
    o.separator ""
  end
  argv = parse_options(opts)
  return if !argv

  with_target_vms(argv) do |machine|
    safe_puts sshconfig machine
    safe_puts
  end
  0
end