Class: GitCompound::Command::Options
- Inherits:
-
Object
- Object
- GitCompound::Command::Options
- 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
-
#initialize(argv) ⇒ Options
constructor
A new instance of Options.
- #parse ⇒ Object
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) 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
#parse ⇒ Object
18 19 20 |
# File 'lib/git_compound/command/options.rb', line 18 def parse [procedure, ] end |