Class: Vagrant::Hmurca::Command
- Inherits:
-
Object
- Object
- Vagrant::Hmurca::Command
- Defined in:
- lib/vagrant/hmurca/command.rb
Overview
Internal: Hmurca command that generates project scaffold.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.synopsis ⇒ Object
43 44 45 |
# File 'lib/vagrant/hmurca/command.rb', line 43 def self.synopsis "initializes hmurca-powered project" end |
Instance Method Details
#execute ⇒ Object
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/vagrant/hmurca/command.rb', line 47 def execute argv = (option_parser) if argv.empty? @env.ui.error "You must specify domain name for development formation." exit(1) end if argv.size > 2 @env.ui.error "Too many actual arguments." exit(1) end Generator.start(argv) end |
#option_parser ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/vagrant/hmurca/command.rb', line 63 def option_parser OptionParser.new do |o| o. = "Usage: vagrant hmurca DOMAIN [ROOT]" o.on("-h", "--help", "Print this help.") do safe_puts(o.help) exit(0) end o.on("-p", "--plugin-version", "Print version of installed Hmurca Kit.") do safe_puts("Hmurca Vagrant Kit #{Vagrant::Hmurca::VERSION}") exit(0) end end end |