Class: HoneyFormat::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/honey_format/cli/cli.rb

Overview

Main CLI

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv: ARGV, io: STDOUT) ⇒ CLI

Instantiate the CLI



13
14
15
16
17
# File 'lib/honey_format/cli/cli.rb', line 13

def initialize(argv: ARGV, io: STDOUT)
  @io = io
  @parser = nil
  @options = parse_options(argv: argv.dup)
end

Instance Attribute Details

#optionsHash (readonly)

from command line arguments

Returns:

  • (Hash)

    the current value of options



8
9
10
# File 'lib/honey_format/cli/cli.rb', line 8

def options
  @options
end

Instance Method Details

#usageObject



19
20
21
# File 'lib/honey_format/cli/cli.rb', line 19

def usage
  @parser.to_s
end