#!/usr/bin/env ruby require 'trollop' STDIN.set_encoding 'utf-8' STDOUT.set_encoding 'utf-8' cfg = Trollop::options do opt :grammar, "(Absolute) path of folder containing grammars.", :type => :string, :short => '-g', :required => true opt :loo, "leave one out", :type => :bool, :default => false opt :start_id, "start with this id", :type => :int, :default => 0, :short => '-i' opt :nogz, "grammar files not gzipped", :type => :bool, :default => false end i = cfg[:start_id] while line = STDIN.gets ext = '.gz' ext = '' if cfg[:nogz] s = " #{line.strip} " i+=1 end