#!/usr/bin/perl -w

print "const char *helptext[] = {\n";

while(<>) {
	chomp;
	next if /^---/;
	if(/^-[-a-zA-Z\d]/) {
		$opt = $_;
		next;
	}
	if($opt && (/^\.\. (.*)$/)) {
		print "\t\"  $opt: $1\",\n";
		undef $opt;
	}
}

print "\t(const char*)0\n};\n";
