Class: VagrantSpec::Command::Version

Inherits:
Object
  • Object
show all
Defined in:
lib/vagrant_spec/command/version.rb

Overview

Provide CLI interface to retrieving version information

Instance Method Summary collapse

Instance Method Details

#executeObject



14
15
16
17
# File 'lib/vagrant_spec/command/version.rb', line 14

def execute
  return unless parse_opts
  @env.ui.info("vagrant_spec: #{VagrantSpec::VERSION}")
end

#intiialize(argv, env) ⇒ Object



9
10
11
12
# File 'lib/vagrant_spec/command/version.rb', line 9

def intiialize(argv, env)
  @env  = env
  @argv = argv
end

#parse_optsObject



19
20
21
22
23
24
25
26
27
# File 'lib/vagrant_spec/command/version.rb', line 19

def parse_opts
  opts = OptionParser.new do |o|
    o.banner = "\nVersion: Output the version of the plugin"
    o.separator ''
    o.separator 'Usage: vagrant spec version'
    o.separator ''
  end
  parse_options(opts)
end