Class: Morpheus::Cli::VersionCommand
- Inherits:
-
Object
- Object
- Morpheus::Cli::VersionCommand
- Includes:
- CliCommand
- Defined in:
- lib/morpheus/cli/version_command.rb
Instance Method Summary collapse
- #handle(args) ⇒ Object
-
#initialize ⇒ VersionCommand
constructor
A new instance of VersionCommand.
- #usage ⇒ Object
Methods included from CliCommand
#build_common_options, included
Constructor Details
#initialize ⇒ VersionCommand
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) = {} 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 end end |
#usage ⇒ Object
12 13 14 |
# File 'lib/morpheus/cli/version_command.rb', line 12 def usage "morpheus version" end |