Class: VagrantPeach::Command
- Inherits:
-
Object
- Object
- VagrantPeach::Command
- Defined in:
- lib/vagrant-peach/command.rb
Instance Method Summary collapse
Instance Method Details
#execute ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/vagrant-peach/command.rb', line 3 def execute opts = OptionParser.new do |o| o. = "Usage: vagrant free-memory [--help]" end argv = (opts) with_target_vms(argv) do |machine| if machine.state.id != :running @env.ui.info("#{machine.name} is not running.") next end command = "grep MemFree /proc/meminfo | awk '{print $2}'" machine.communicate.execute(command) do |type, data| @env.ui.info(data) end end return 0 end |