Class: GitCompound::Command::Options

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/git_compound/command/options.rb

Overview

Class that parses command arguments

Constant Summary collapse

GLOBAL_OPTIONS =
[:verbose, :disable_colors]

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ Options

Returns a new instance of Options.



13
14
15
16
# File 'lib/git_compound/command/options.rb', line 13

def initialize(argv)
  @parser = Arguments::Parser.new(argv, GLOBAL_OPTIONS)
  set_global_options
end

Class Method Details

.disable_colors=(mode) ⇒ Object



26
27
28
# File 'lib/git_compound/command/options.rb', line 26

def self.disable_colors=(mode)
  GitCompound::Logger.colors = !mode
end

.verbose=(mode) ⇒ Object



22
23
24
# File 'lib/git_compound/command/options.rb', line 22

def self.verbose=(mode)
  GitCompound::Logger.verbose = mode
end

Instance Method Details

#parseObject



18
19
20
# File 'lib/git_compound/command/options.rb', line 18

def parse
  [procedure, options]
end