Sha256: c70a5bd8bdba8e18bcce0bdc2ba27be5d31632f3c03859d16c7c0a94670746f2

Contents?: true

Size: 1.16 KB

Versions: 17

Compression:

Stored size: 1.16 KB

Contents

#!/usr/bin/env ruby

require 'optparse'

require 'markdown_helper'

options = {:pristine => false}

# Save opts for use below.
opts = nil
parser = OptionParser.new do |_opts|
  opts = _opts
  _opts.banner = "Usage: #{File.basename(__FILE__)} [options] template_file_path markdown_file_path"
  _opts.on('--pristine', 'No comments added') do |_|
    options[:pristine] = true
  end
  _opts.on('--help', 'Display help') do
    usage(_opts)
  end
end

def usage(opts)
  puts ''
  puts opts
  puts <<-EOT
    
  where

    * template_file_path is the path to an existing file.
    * markdown_file_path is the path to a file to be created.

  Typically:

    * Both file types are .md.
    * The template file contains file inclusion descriptions.
EOT
  exit
end

parser.parse!

template_file_path, markdown_file_path = ARGV

usage(opts) unless ARGV.size == 2
usage(opts) unless File.readable?(template_file_path)
usage(opts) unless File.writable?(File.dirname(markdown_file_path))

warn('This include is deprecated.  Please use command "markdown_helper include".')
MarkdownHelper.new(options).include(template_file_path, markdown_file_path)

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
markdown_helper-2.5.4 bin/include
markdown_helper-2.5.3 bin/include
markdown_helper-2.5.2 bin/include
markdown_helper-2.5.1 bin/include
markdown_helper-2.5.0 bin/include
markdown_helper-2.4.0 bin/include
markdown_helper-2.3.0 bin/include
markdown_helper-2.2.0 bin/include
markdown_helper-2.1.0 bin/include
markdown_helper-2.0.0 bin/include
markdown_helper-1.9.9 bin/include
markdown_helper-1.9.5 bin/include
markdown_helper-1.9.0 bin/include
markdown_helper-1.8.0 bin/include
markdown_helper-1.7.0 bin/include
markdown_helper-1.6.1 bin/include
markdown_helper-1.6.0 bin/include