module CommandKit::Options::Version

Defines a version option.

Public Class Methods

included(command) click to toggle source

Includes {Options}, extends {Version::ClassMethods}, and defines a `-V, –version` option.

# File lib/command_kit/options/version.rb, line 13
def self.included(command)
  command.include Options
  command.extend ClassMethods

  command.option :version, short: '-V',
                           desc: 'Prints the version and exits' do
    print_version
    exit(0)
  end
end

Public Instance Methods

print_version() click to toggle source

Prints the version.

@api public

version() click to toggle source

@see ClassMethods#version

@api public

# File lib/command_kit/options/version.rb, line 54
def version
  self.class.version
end