Class: Djin::RootCliParser

Inherits:
Object
  • Object
show all
Defined in:
lib/djin/root_cli_parser.rb

Overview

This class is responsible to handle options that must be evaluated

before the load of tasks in djin file(eg: djin.yml)

Class Method Summary collapse

Class Method Details

.parse!(args = ARGV) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/djin/root_cli_parser.rb', line 8

def parse!(args = ARGV)
  options = {}

  # TODO: Find a better way to handle -f/--file option,
  #       throw, catch and delete in ARGV are necessary
  #       to only remove the -f/--file option
  #       and bypass everything else to Dry::CLI
  catch(:root_cli_exit) do
    parser(options).parse(args)
  end

  remove_file_args!(args)
  options
end