Module: Lorca::CLI

Defined in:
lib/lorca/expansions/cli.rb

Overview

:nodoc:

Defined Under Namespace

Modules: LorcaPlugin

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.load_dependencies(expansion, **_) ⇒ Object



29
30
31
# File 'lib/lorca/expansions/cli.rb', line 29

def self.load_dependencies expansion, **_
  expansion.add Lorca::Phrases
end

Instance Method Details

#parse(argv = $argv, writer: Lorca.new, stash: Clipboard, outlet: $stdout) ⇒ Object



33
34
35
36
37
38
39
40
41
42
43
# File 'lib/lorca/expansions/cli.rb', line 33

def parse argv=$argv, writer:Lorca.new, stash: Clipboard, outlet: $stdout
  cli = OptionParser.new do |parser|
    write_phrase parser, outlet, writer, stash
    display_help parser, outlet
    display_version parser, outlet
  end

  cli.parse!(*argv)

  outlet.puts cli
end