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