Class: Rubysmith::CLI::Parsers::Core

Inherits:
Object
  • Object
show all
Defined in:
lib/rubysmith/cli/parsers/core.rb

Overview

Handles parsing of Command Line Interface (CLI) core options.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configuration = Container[:configuration], client: Parser::CLIENT) ⇒ Core

Returns a new instance of Core.



17
18
19
20
21
# File 'lib/rubysmith/cli/parsers/core.rb', line 17

def initialize(configuration = Container[:configuration], client: Parser::CLIENT, **)
  super(**)
  @configuration = configuration
  @client = client
end

Class Method Details

.callObject



15
# File 'lib/rubysmith/cli/parsers/core.rb', line 15

def self.call(...) = new(...).call

Instance Method Details

#call(arguments = ::Core::EMPTY_ARRAY) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/rubysmith/cli/parsers/core.rb', line 23

def call arguments = ::Core::EMPTY_ARRAY
  client.banner = specification.labeled_summary
  client.separator "\nUSAGE:\n"
  collate
  client.parse arguments
  configuration
end