aboutsummaryrefslogtreecommitdiff
path: root/src/mkusage.pl
blob: d8a5c77d696e069d205981432a7ceffcd6f6c579 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/perl -w

print "const char *usage_msg[] = {\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";