Sha256: 4b01c3d8859f3da9da67f0ff1543623f2a28ef32339113e19fd2b48b14f47d4e
Contents?: true
Size: 763 Bytes
Versions: 15
Compression:
Stored size: 763 Bytes
Contents
begin require 'trollop' rescue LoadError require 'rubygems' require 'trollop' end require 'gherkin/tools' module Gherkin module Cli class Main def self.run(args) Trollop::options(args) do banner "Super fast gherkin parser" stop_on Tools::SUB_COMMANDS end cmd_name = args.shift die("Missing command") if cmd_name.nil? begin cmd = Tools.const_get(cmd_name.capitalize.to_sym).new(args) cmd.run rescue => e Trollop::die(e.message + "\nCommand: #{cmd_name}") end end def self.die(msg) Trollop::die("#{msg}\nusage: gherkin COMMAND [ARGS]\nAvailable commands: #{Tools::SUB_COMMANDS.join(' ')}") end end end end
Version data entries
15 entries across 15 versions & 1 rubygems