Class: VagrantPlugins::Dotvm::Command
- Inherits:
-
Object
- Object
- VagrantPlugins::Dotvm::Command
- Defined in:
- lib/vagrant-dotvm/command.rb
Constant Summary collapse
- COMMANDS =
%w(init)
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.synopsis ⇒ Object
8 9 10 |
# File 'lib/vagrant-dotvm/command.rb', line 8 def self.synopsis 'manages DotVM configuration' end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/vagrant-dotvm/command.rb', line 12 def execute opts = OptionParser.new do |o| o. = sprintf 'Usage: vagrant dotvm <%s>', COMMANDS.join('|') o.separator '' o.on('-h', '--help', 'Print this help') do safe_puts(opts.help) return nil end end argv = (opts) command = argv[0] if !command || !COMMANDS.include?(command) safe_puts opts.help return nil end send("command_#{command}") end |