### Home Classes Methods

### In Files

- lib/gherkin/cli/main.rb

### Parent

Object

### Methods

- ::die
- ::run

### Files

- LICENSE
- README.rdoc
- meta.txt
- root.txt
- steps.txt
- README.rdoc

### Class/Module Index

Quicksearch

- Gherkin
- Gherkin::CLexer
- Gherkin::Cli
- Gherkin::Cli::Main
- Gherkin::Formatter
- Gherkin::Formatter::Argument
- Gherkin::Formatter::Colors
- Gherkin::Formatter::Escaping
- Gherkin::Formatter::JSONFormatter
- Gherkin::Formatter::MonochromeFormat
- Gherkin::Formatter::PrettyFormatter
- Gherkin::I18n
- Gherkin::I18nLexer
- Gherkin::JSONLexer
- Gherkin::Parser
- Gherkin::Parser::Event
- Gherkin::Parser::FilterListener
- Gherkin::Parser::FormatterListener
- Gherkin::Parser::ParseError
- Gherkin::Parser::Parser
- Gherkin::Parser::Parser::Machine
- Gherkin::Parser::Parser::Machine::StateMachineReader
- Gherkin::Parser::Row
- Gherkin::Parser::TagExpression
- Gherkin::RbLexer
- Gherkin::Rubify
- Gherkin::Tools
- Gherkin::Tools::Files
- Gherkin::Tools::Reformat
- Gherkin::Tools::Stats
- Gherkin::Tools::StatsListener
- Class

No matching classes.

# Gherkin::Cli::Main

### Public Class Methods

die(msg) click to toggle source

    # File lib/gherkin/cli/main.rb, line 28
    def self.die(msg)
      Trollop::die("#{msg}\nusage: gherkin COMMAND [ARGS]\nAvailable commands: #{Tools::SUB_COMMANDS.join(' ')}")
    end

run(args) click to toggle source

    # File lib/gherkin/cli/main.rb, line 12
    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 + "\n#{e.backtrace.join("\n")}\n\nCommand: #{cmd_name}")
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.