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

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

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

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