Module: Dry::CLI::Usage

Defined in:
lib/patches/dry-cli.rb

Class Method Summary collapse

Class Method Details

.call(result) ⇒ String

Overwrites the original ‘call’ method to allow a global header and footer wrap for the help text.

Returns:

  • (String)

    modified help text



124
125
126
127
128
129
130
131
132
133
134
# File 'lib/patches/dry-cli.rb', line 124

def call(result)
	help_text = original_call(result)

	global_header 	= Dry::CLI::Command.global_header
	global_footer 	= Dry::CLI::Command.global_footer

	help_text.prepend(global_header + "\n") unless (global_header.nil? || global_header.empty?)
	help_text += "\n" + global_footer 			unless (global_footer.nil? || global_footer.empty?)

	help_text
end

.original_callObject



118
# File 'lib/patches/dry-cli.rb', line 118

alias_method :original_call, :call