#!/usr/bin/env ruby # # Code Author: # Original Program Template: Eric Armstrong #------------------------------------------ def print_usage print < #{$0} -h where: -h prints usage instructions (help) USAGE exit end print_usage if ARGV[0] == nil #------------------------------------------ require 'getoptlong' opt = GetoptLong.new( ['--indent', '-i', GetoptLong::REQUIRED_ARGUMENT], ['--help', '-h', GetoptLong::NO_ARGUMENT] ) opt.each_option do |name,arg| case name when '--help' print_usage exit end end @file = ARGV[0] #------------------------------------------ File.readlines(@file).each do |line| if line.include? ... then ... end end