Sha256: 383982e8610a827cc853ec2261ef73553d53ff28edc44f1df30778ef2880a204
Contents?: true
Size: 776 Bytes
Versions: 36
Compression:
Stored size: 776 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? cmd = Tools.const_get(cmd_name.capitalize.to_sym).new(args) rescue die("Unknown command #{cmd_name}") begin cmd.run rescue => e Trollop::die(e.message) 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
36 entries across 36 versions & 1 rubygems