#!/usr/bin/perl -w print "char *usage_opts[] = {\n"; while(<>) { chomp; if(/^-[a-zA-Z]/) { $opt = $_; next; } if($opt && (/^\.\. (.*)$/)) { print "\t\" $opt: $1\",\n"; undef $opt; } } # don't use NULL, it's not defined. print "\t(char *)0\n};\n";