Method: QB::Options.parse!

Defined in:
lib/qb/options.rb

.parse!(role, argv) ⇒ Array<Hash<String, Option|Object>>

Destructively removes options from @argv and populates ansible, role, and qb option hashes.

Parameters:

  • role (QB::Role)

    the role to parse the options for.

  • args (Array<String>)

    CLI args -- ARGV with the role arg shifted off.

Returns:

  • (Array<Hash<String, Option|Object>>)

    a two-element array:

    1. the options for the role, hash of Option#cli_name to Option instances.

    2. the general qb options, hash of String key to option values.

Raises:

  • if bad options are found.



175
176
177
178
# File 'lib/qb/options.rb', line 175

def self.parse! role, argv
  options = self.new role, argv
  [options.role_options, options.qb]
end