Class: Morpheus::Cli::EchoCommand
- Inherits:
-
Object
- Object
- Morpheus::Cli::EchoCommand
- Includes:
- CliCommand
- Defined in:
- lib/morpheus/cli/echo_command.rb
Overview
This is for use in dotfile scripts
Instance Attribute Summary
Attributes included from CliCommand
Instance Method Summary collapse
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, #usage, #verify_access_token!
Instance Method Details
#handle(args) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/morpheus/cli/echo_command.rb', line 11 def handle(args) append_newline = true = {} optparse = Morpheus::Cli::OptionParser.new do|opts| opts. = "Usage: morpheus #{command_name} [<message>]" opts.on( '-n', '--nonewline', "do not append a newline to your words" ) do append_newline = false end (opts, , []) end optparse.parse!(args) out = "" out << args.join(' ') if append_newline out << "\n" end # print out print cyan + out + reset return true end |