#!/usr/bin/env ruby require 'optparse' require 'typogen' options = {} opt_parse = OptionParser.new do |opt| opt.banner = "Usage: typogen [options] word" opt.on("-v", "--version", "display the typogen version.") { options[:version] = true } opt.parse!(ARGV) end TypoGen::OPTIONS.merge!(options) case when options[:version] puts "TypoGen version: #{TypoGen::VERSION}" when ARGV.first.nil? puts opt_parse else TypoGen::CLI.run(ARGV.first, options: {}) end