7 ##################### CLASSES #####################
14 parser = OptionParser.new do |myparser|
15 myparser.banner = "Usage: #{$0} [opts]"
16 myparser.separator "Specific options:"
17 myparser.on("-w WIDTH", "--width",
18 "The maximum width of the enum identifier.") do |a|
28 ##################### FUNCTIONS #####################
29 ##################### CODE #####################
30 $opts = MyOptionParse.parse(ARGV)
33 STDIN.each_line do |line|
35 if line =~ /\#define[ \t]([^ \t]*)[ \t][ \t]*([^ \t]*)/ then
38 ident2 = "#{ident} = "
39 printf(" %-#{$opts.width}s %s,\n", ident2, val)