aboutsummaryrefslogtreecommitdiff
path: root/mkusage.pl
diff options
context:
space:
mode:
Diffstat (limited to 'mkusage.pl')
-rw-r--r--mkusage.pl18
1 files changed, 18 insertions, 0 deletions
diff --git a/mkusage.pl b/mkusage.pl
new file mode 100644
index 0000000..f8fe485
--- /dev/null
+++ b/mkusage.pl
@@ -0,0 +1,18 @@
+#!/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";