Class: Omnitest::Core::CLI

Inherits:
Thor
  • Object
show all
Includes:
PerformCommand, Logging
Defined in:
lib/omnitest/core/cli.rb

Defined Under Namespace

Modules: PerformCommand

Class Attribute Summary collapse

Attributes included from PerformCommand

#action

Class Method Summary collapse

Methods included from PerformCommand

#perform

Class Attribute Details

.extra_argsObject

Override Thor’s start to strip extra_args from ARGV before it’s processed



40
41
42
# File 'lib/omnitest/core/cli.rb', line 40

def extra_args
  @extra_args
end

Class Method Details

.start(given_args = ARGV, config = {}) ⇒ Object



42
43
44
45
46
47
48
49
50
51
# File 'lib/omnitest/core/cli.rb', line 42

def start(given_args = ARGV, config = {})
  if given_args && (split_pos = given_args.index('--'))
    @extra_args = given_args.slice(split_pos + 1, given_args.length).map do | arg |
      # Restore quotes
      arg.match(/\=/) ? restore_quotes(arg) : arg
    end
    given_args = given_args.slice(0, split_pos)
  end
  super given_args, config
end