Class: VagrantPlugins::ListenServer::Command
- Inherits:
-
Object
- Object
- VagrantPlugins::ListenServer::Command
- Defined in:
- lib/vagrant-listen-server/command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.synopsis ⇒ Object
4 5 6 |
# File 'lib/vagrant-listen-server/command.rb', line 4 def self.synopsis "Check the status of the vagrant-listen server" end |
Instance Method Details
#execute ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vagrant-listen-server/command.rb', line 8 def execute opts = OptionParser.new do |o| o. = 'Usage: vagrant listen [start|stop|status]' end command = @argv.shift argv = opts with_target_vms nil, single_target: true do |vm| # puts "ENV #{vm.env.inspect}" # puts "CONFIG #{vm.config.inspect}" # puts "LISTEN #{vm.config.listen_server.inspect}" case command when 'status' then Daemon.status vm.config.listen_server when 'stop' then Daemon.stop vm when 'start' then Daemon.start vm else puts 'Unknown command' exit 1 end end 0 end |