#!/usr/bin/env ruby $:.unshift File.join(File.dirname(__FILE__), *%w[.. lib]) require 'rubygems' require 'optiflag' require 'visage' ##################################################### # Setup Command Line Options # ##################################################### module VisageOptions extend OptiFlagSet optional_flag "source" do alternate_forms "s", "S" description "Specifies the directory in which Visage will look for source files, or the filename of a specific source file. If not specified visage will assume the current working directory is its source." default '.' end optional_flag "destination" do alternate_forms "d", "D" description "Specifies the directory into which Visage will deposit the generates iso(s). If not specifies Visage will use the current working directory." default '.' end optional_switch_flag "version" do alternate_forms "v", "V" description "Returns version information." end optional_switch_flag "test" do alternate_forms "t", "T" default false description "Puts visage into test mode and will only print commands, not run them." end and_process! end ##################################################### # Run # ##################################################### if( ARGV.flags.version? ) puts Visage.version else converter = Visage::Converter.new( ARGV.flags.source, ARGV.flags.destination, ARGV.flags.test? ) converter.process end