Class: VagrantPlugins::Mount::Command::Unmount
- Inherits:
-
Object
- Object
- VagrantPlugins::Mount::Command::Unmount
- Defined in:
- lib/vagrant-mount/commands/unmount.rb
Class Method Summary collapse
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(argv, env) ⇒ Unmount
constructor
A new instance of Unmount.
Constructor Details
#initialize(argv, env) ⇒ Unmount
Returns a new instance of Unmount.
12 13 14 15 |
# File 'lib/vagrant-mount/commands/unmount.rb', line 12 def initialize(argv, env) @env=env super end |
Class Method Details
.synopsis ⇒ Object
8 9 10 |
# File 'lib/vagrant-mount/commands/unmount.rb', line 8 def self.synopsis 'Unmount ISO from Virtual Machine' end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/vagrant-mount/commands/unmount.rb', line 17 def execute = { remove_device: false } parser = OptionParser.new do |opts| opts. = 'Usage: vagrant unmount [options] [vm-name]' opts.separator '' opts.separator ' Options:' opts.on("--iso path", "The path of the ISO to unmount") { |arg| [:path] = arg } opts.on("--remove-device", "Remove the controller/device/port after unmounting") { |arg| [:remove_device] = true } end argv = (parser) return unless argv argv << "default" if argv.empty? with_target_vms(argv) do |vm| vm.action(:unmount, mount_point: [:path], remove_device: [:remove_device]) end 0 end |