Class: Specifier::CLI

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

Overview

Used when interacting with the suite from the command line interface (CLI).

Usage:

cli = Specifier::CLI.new
cli.parse

Constant Summary collapse

'usage: specifier [options] [./specs]'.freeze

Instance Method Summary collapse

Instance Method Details

#parse(items = ARGV) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/specifier/cli.rb', line 13

def parse(items = ARGV)
  config = Slop.parse(items) do |options|
    options.banner = BANNER

    options.on '-h', '--help', 'help' do
      return help(options)
    end

    options.on '-v', '--version', 'version' do
      return version
    end

    options.string '-f', '--formatter', 'formatter', default: Specifier::Formatter::DEFAULT
  end

  run(config)
end