Class: Morpheus::Cli::VersionCommand
- Inherits:
-
Object
- Object
- Morpheus::Cli::VersionCommand
- Includes:
- CliCommand
- Defined in:
- lib/morpheus/cli/version_command.rb
Instance Attribute Summary
Attributes included from CliCommand
Instance Method Summary collapse
- #handle(args) ⇒ Object
-
#initialize ⇒ VersionCommand
constructor
A new instance of VersionCommand.
- #usage ⇒ Object
Methods included from CliCommand
#build_common_options, #build_option_type_options, #command_name, #default_subcommand, #establish_remote_appliance_connection, #handle_subcommand, included, #interactive?, #noninteractive, #print_usage, #subcommand_aliases, #subcommand_usage, #subcommands, #verify_access_token!
Constructor Details
#initialize ⇒ VersionCommand
Returns a new instance of VersionCommand.
8 9 |
# File 'lib/morpheus/cli/version_command.rb', line 8 def initialize end |
Instance Method Details
#handle(args) ⇒ Object
15 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 |
# File 'lib/morpheus/cli/version_command.rb', line 15 def handle(args) = {} optparse = OptionParser.new do|opts| opts. = usage opts.on('-v','--short', "Print only the client version number") do |val| [:short] = true end (opts, ) end optparse.parse!(args) client_version = Morpheus::Cli::VERSION if [:short] puts client_version else print cyan = "" + " __ ___ __ \n" + " / |/ /__ _______ / / ___ __ _____\n" + " / /|_/ / _ \\/ __/ _ \\/ _ \\/ -_) // (_-<\n" + "/_/ /_/\\___/_/ / .__/_//_/\\__/\\_,_/___/\n" + "****************************************" puts() puts(" Client Version: #{client_version}") puts("****************************************") print reset,"\n" end end |
#usage ⇒ Object
11 12 13 |
# File 'lib/morpheus/cli/version_command.rb', line 11 def usage "morpheus version" end |