Sha256: 3ccc0c31cb7125d2086f987cec9294f10e2c1044a5420e82e1279a62fb0bdecd

Contents?: true

Size: 437 Bytes

Versions: 1

Compression:

Stored size: 437 Bytes

Contents

require 'text2svg/typography'

module Text2svg
  module CLI
    Option = Struct.new(:font)

    def start
      o = CLI::Option.new
      OptionParser.new.tap { |opt|
        opt.on('-f', '--font [FONT]', 'font file path (require)') do |arg|
          o.font = arg
        end
      }.parse!(ARGV)
      text = ARGV[0] || $stdin.read
      puts Text2svg::Typography.build(text, font: o.font)
    end
    module_function :start
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
text2svg-0.0.1 lib/text2svg/cli.rb