Class: Morpheus::Cli::VersionCommand

Inherits:
Object
  • Object
show all
Includes:
CliCommand
Defined in:
lib/morpheus/cli/version_command.rb

Instance Method Summary collapse

Methods included from CliCommand

#build_common_options, included

Constructor Details

#initializeVersionCommand

Returns a new instance of VersionCommand.



9
10
# File 'lib/morpheus/cli/version_command.rb', line 9

def initialize
end

Instance Method Details

#handle(args) ⇒ Object



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/morpheus/cli/version_command.rb', line 16

def handle(args)
   options = {}
   optparse = OptionParser.new do|opts|
     opts.banner = usage
     opts.on('-v','--short', "Print only the client version number") do |val|
       options[:short] = true
     end
     build_common_options(opts, options)
   end
   optparse.parse(args)

	client_version = Morpheus::Cli::VERSION
	 if options[:short]
   	puts client_version
   else
   	print cyan
     banner = "" +
     "   __  ___              __              \n" +
     "  /  |/  /__  _______  / /  ___ __ _____\n" +
     " / /|_/ / _ \\/ __/ _ \\/ _ \\/ -_) // (_-<\n" +
     "/_/  /_/\\___/_/ / .__/_//_/\\__/\\_,_/___/\n" +
     "****************************************"
     puts(banner)
     puts("  Client Version: #{client_version}")
     puts("****************************************")
     print reset
   end
end

#usageObject



12
13
14
# File 'lib/morpheus/cli/version_command.rb', line 12

def usage
  "morpheus version"
end