Class: VagrantShellCommander::OptionManager
- Inherits:
-
Object
- Object
- VagrantShellCommander::OptionManager
- Defined in:
- lib/vagrant-shell-commander/option_manager.rb
Overview
Option parser
Instance Method Summary collapse
-
#execute ⇒ Hash
Main parsing method.
Instance Method Details
#execute ⇒ Hash
Main parsing method
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/vagrant-shell-commander/option_manager.rb', line 9 def execute = {} block = lambda do |parser| parser. = "Usage: vagrant sh --cmd 'COMMAND' --cwd [DIR] [MACHINE]" parser.separator '' parser.on('--cwd [DIR]', '--change-working-dir [DIR]', 'Directory to execute the command') do |cwd| [:cwd] = cwd end parser.on("--cmd 'COMMAND'", "--command 'COMMAND'", 'Command to execute') do |cmd| [:cmd] = cmd end end {parser: OptionParser.new(&block), values: } end |