Class: VagrantPlugins::Mosh::Command
- Inherits:
-
Object
- Object
- VagrantPlugins::Mosh::Command
- Defined in:
- lib/vagrant-mosh/command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.synopsis ⇒ Object
4 5 6 |
# File 'lib/vagrant-mosh/command.rb', line 4 def self.synopsis 'connects to machine via Mosh' end |
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vagrant-mosh/command.rb', line 8 def execute opts = OptionParser.new do |o| o. = 'Usage: vagrant mosh [vm-name]' o.separator '' end argv = (opts) return unless argv with_target_vms(argv, single_target: true) do |vm| ssh_info = vm.ssh_info switch_to_remote_ip(ssh_info, vm) if localhost?(ssh_info[:host]) mosh_command = ['mosh', *mosh_arguments(ssh_info)].join(' ') Vagrant::Util::SafeExec.exec(mosh_command) end end |