Module: Cliqr::Parser Private

Defined in:
lib/cliqr/parser/argument_parser.rb,
lib/cliqr/parser/token.rb,
lib/cliqr/parser/action_token.rb,
lib/cliqr/parser/option_token.rb,
lib/cliqr/parser/parsed_input.rb,
lib/cliqr/parser/token_factory.rb,
lib/cliqr/parser/argument_token.rb,
lib/cliqr/parser/argument_tree_walker.rb,
lib/cliqr/parser/boolean_option_token.rb,
lib/cliqr/parser/parsed_input_builder.rb,
lib/cliqr/parser/single_valued_option_token.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

A set of utility methods and classes used to parse the command line arguments

Defined Under Namespace

Classes: ActionToken, ArgumentToken, ArgumentTreeWalker, BooleanOptionToken, OptionToken, ParsedInput, ParsedInputBuilder, SingleValuedOptionToken, Token, TokenFactory

Class Method Summary collapse

Class Method Details

.parse(config, args) ⇒ Hash

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parse command line arguments based on [Cliqr::CLI::Config]

Parameters:

  • config (Cliqr::CLI::Config)

    Command line configuration

  • args (Array<String>)

    An array of arguments from command line

Returns:

  • (Hash)

    Parsed action config and hash of command line arguments



16
17
18
19
# File 'lib/cliqr/parser/argument_parser.rb', line 16

def self.parse(config, args)
  tree_walker = ArgumentTreeWalker.new(config)
  tree_walker.walk(args)
end