Object
# File lib/generator/application.rb, line 21 21: def run 22: process_args 23: if ARGV.size == 2 24: File.open(ARGV[1], 'w') do |file| 25: file << FFI::Generator::Parser.new.generate(Nokogiri::XML(File.open(ARGV[0]))) 26: end 27: else 28: help 29: raise "Invalid number of arguments!" 30: end 31: end
# File lib/generator/application.rb, line 43 43: def command_line_options 44: OPTIONS.collect { |lst| lst[0..2] } 45: end
# File lib/generator/application.rb, line 33 33: def do_option(option, value = nil) 34: case option 35: when '--help' 36: help 37: exit 38: when '--version' 39: puts "ffi-swig-generator, version #{Generator::VERSION}\n" 40: exit 41: end 42: end
# File lib/generator/application.rb, line 50 50: def help 51: puts 52: puts USAGE_PREAMBLE 53: puts "Recognized options are:" 54: puts 55: OPTIONS.sort.each do |long, short, mode, desc| 56: if mode == GetoptLong::REQUIRED_ARGUMENT 57: if desc =~ /\b([A-Z]{2,})\b/ 58: long = long + "=#{$1}" 59: end 60: end 61: printf " %-20s (%s)\n", long, short 62: printf " %s\n", desc 63: puts 64: end 65: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.