Class: VagrantPlugins::Provider::ListCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- VagrantPlugins::Provider::ListCommand
- Defined in:
- lib/vagrant-provider/list-command.rb
Instance Method Summary collapse
Methods inherited from BaseCommand
#active_provider, #line, #machine_folder, #machine_names, #machine_provider, #provider_name, #providers_for
Instance Method Details
#execute ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/vagrant-provider/list-command.rb', line 5 def execute opts = OptionParser.new do |o| o. = "Usage: vagrant provider list" o.separator "" o.separator "List all active providers" end # Parse the options argv = (opts) return if !argv line "Machines" line "--------" line machine_names.each do |machine_name| line "#{machine_name}:" providers_for(machine_name).each do |provider| line " #{provider[:name]}" << (provider[:active] ? " (active)" : "") end end # Success, exit status 0 0 end |