#! ruby
require File.dirname(__FILE__) + '/legal_markdown/version'
require File.dirname(__FILE__) + '/legal_markdown/make_yaml_frontmatter.rb'
require File.dirname(__FILE__) + '/legal_markdown/legal_to_markdown.rb'

module LegalMarkdown

  def self.parse(*args)
    args = ARGV.dup
    if(!args[0])
      STDERR.puts "Sorry, I didn't understand that. Please give me your legal_markdown filenames or \"-\" for stdin."
      exit 0
    elsif args.include?("--headers")
      LegalMarkdown::MakeYamlFrontMatter.new(args)
    else
      LegalMarkdown::LegalToMarkdown.parse_markdown(args)
    end
  end
end
#! ruby
require File.dirname(__FILE__) + '/legal_markdown/version'
require File.dirname(__FILE__) + '/legal_markdown/make_yaml_frontmatter.rb'
require File.dirname(__FILE__) + '/legal_markdown/legal_to_markdown.rb'

module LegalMarkdown

  def self.parse(*args)
    args = ARGV.dup
    if(!args[0])
      STDERR.puts "Sorry, I didn't understand that. Please give me your legal_markdown filenames or \"-\" for stdin."
      exit 0
    elsif args.include?("--headers")
      LegalMarkdown::MakeYamlFrontMatter.new(args)
    else
      LegalMarkdown::LegalToMarkdown.parse_markdown(args)
    end
  end
end

# if launched as a standalone program, not loaded as a module
LegalToMarkdown.parse if __FILE__ == $0
Add code to run if standalone feature
Add code to run if standalone feature
