Class: SubCommandBase

Inherits:
Thor
  • Object
show all
Includes:
InputConverters, OptionsParser, OutputConverters
Defined in:
lib/emasser/get.rb,
lib/emasser/put.rb,
lib/emasser/post.rb,
lib/emasser/delete.rb

Overview

Hack class that properly formats the CLI help

Class Method Summary collapse

Methods included from OutputConverters

#to_output_hash

Methods included from InputConverters

#to_input_hash

Methods included from OptionsParser

#optional_options, #required_options

Class Method Details

rubocop:disable Style/OptionalBooleanParameter



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/emasser/get.rb', line 14

def self.banner(command, _namespace = nil, subcommand = false)
  # Use the $thor_runner (declared by the Thor CLI framework)
  # to properly format the help text of sub-sub-commands.

  # rubocop:disable Style/GlobalVars
  if ancestors[0].to_s.include? '::Get'
    "#{basename} #{command.formatted_usage(self, $thor_runner, subcommand)}"
  else
    "#{basename} get #{command.formatted_usage(self, $thor_runner, subcommand)}"
  end
  # rubocop:enable Style/GlobalVars
end