Sha256: 64abdecf3fdada753d840ffaddd3420a6f1d7adab5f68f853b2995bf8ad97f53

Contents?: true

Size: 593 Bytes

Versions: 2

Compression:

Stored size: 593 Bytes

Contents

#!/usr/bin/env ruby
require 'optparse'
require "md_inc"

base_dir = nil

op = OptionParser.new do |op|
  op.on "-h", "--help", "Print help string" do
    puts op
    exit 0
  end

  op.on "-i dir", "--include dir", "Add this directory to the Ruby path" do |dir|
    $: << dir
  end

  op.on '-d dir', '--dir dir', "Set the default dir for pulling incldue files" do |dir|
    base_dir = dir
  end
end

op.parse!

tp = MdInc::TextProcessor.new
tp.base_dir = base_dir if base_dir

if ARGV.empty?
  puts tp.process_stream(STDIN)
else
  ARGV.each do |path|
    puts tp.process_file(path)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
md_inc-0.2.4 bin/md_inc
md_inc-0.2.3 bin/md_inc