aboutsummaryrefslogtreecommitdiff
path: root/mkusage.pl
blob: 446beab7bcb03b5aaeba4cff7780ae02f50230da (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 "char *usage_opts[] = {\n";

while(<>) {
	chomp;
	next if /^---/;
	if(/^-[-a-zA-Z\d]/) {
		$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";