#!/usr/bin/env ruby begin require 'rubygems' require 'uv' rescue LoadError $:.unshift File.join( File.dirname(__FILE__), '..', 'lib' ) require 'uv' end require 'optparse' require 'ostruct' o = OpenStruct.new o.copy_files = false o.output = "xhtml" o.headers = false o.theme = "espresso_libre" options = OptionParser.new options.banner =< bashrc.html Renders the contents of ~/.bashrc to file bashrc.html as a standalone web page. All options are non-mandatory Options: END options.on( "-c DIR", "--copy-files DIR", < 1 STDERR.puts "Many syntaxes match, please specify" STDERR.puts "\nMatching syntaxes:" candidates.sort.each { |name, syntax| STDERR.puts "\t - " + name} exit -1 end o.syntax = candidates.first.first unless candidates.size == 0 end unless o.syntax STDERR.puts "No default syntax found, please specify" exit -1 end if o.filename o.text = File.read(o.filename) else o.text = STDIN end if o.debug Uv.debug( o.text, o.syntax ) exit end puts Uv.parse( o.text, o.output, o.syntax, ! o.lines, o.theme, o.headers )