Class: ConventionalModels::CLI
- Inherits:
-
Object
- Object
- ConventionalModels::CLI
- Defined in:
- lib/conventional_models/cli.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/conventional_models/cli.rb', line 7 def end |
Instance Method Details
#run(args) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/conventional_models/cli.rb', line 9 def run(args) opts = OptionParser.new = Options.new opts.on('-v', '--version') { .output_version = true } opts.on('-h', '--help') { .output_help = opts } opts.on('-s', '--skip-configure') { .skip_configure = true } opts.on('-c', '--config FILE') { |file| .config = file } opts.on('-e', '--environment ENV') { |env| .environment = env } opts.on('-V', '--verbose') { |env| .verbose = true } begin opts.parse!(args) return output_version if .output_version return output_help(.output_help) if .output_help if .verbose run_console rescue puts opts end end |