Sha256: 84a5b12217f641644dee30a8847fbdbf95702442528eb8cabbad3ef3357647b5

Contents?: true

Size: 1.45 KB

Versions: 2

Compression:

Stored size: 1.45 KB

Contents

require 'barthes/runner'
require 'barthes/reporter/default'
require 'json'
require 'slop'

module Barthes
	class CLI
		def self.parse_options
			@opt = Slop.parse!(help: true) do
			  banner 'Usage: barthes [options] /path/to/some_spec.json'
			  on 'e', 'env',       'environment file paths',               argument: :optional, as: Array
			  on 'q', 'quiet',     'not show test details',                argument: :optional, as: :count
			  on 'f', 'from',      'test number to start from',            argument: :optional, as: Integer, default: 1
			  on 't', 'to',        'test number to stop to',               argument: :optional, as: Integer
			  on 'l', 'load',      'An optional password',                 argument: :optional
			  on 'd', 'dryrun',    'not run test but show just structure', argument: :optional, as: :count
			  on 'c', 'cache',     'cache path',                           argument: :optional, default: './barthes-cache.json'
			  on 'r', 'reporters', 'reporters to use',                     argument: :optional, as: Array
			  on 'j', 'junit-xml', 'junit xml output path',                argument: :optional
			  on 'g', 'tags',      'tags to filter actions',               argument: :optional, as: Array
			  on 'n', 'no-tags',   'tags to filter no actions',            argument: :optional, as: Array
			end
			@opt.to_hash
		end

		def self.start
			options = parse_options
			abort @opt.help if ARGV.empty?
			Runner.new(options).run(ARGV)
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
barthes-0.0.43 lib/barthes/cli.rb
barthes-0.0.42 lib/barthes/cli.rb