diff options
| author | B. Watson <urchlay@slackware.uk> | 2025-11-14 06:27:22 -0500 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2025-11-14 06:27:22 -0500 |
| commit | 0f4d0a93434aa7586c9f66c6a48707b561ebf00a (patch) | |
| tree | b27276f9b2534a7c4026968e36f21fbdacad7eec /src/mkusage.pl | |
| parent | 3e2561662e065f9797f66f3c3663c8e271d1f272 (diff) | |
| download | unalf-0f4d0a93434aa7586c9f66c6a48707b561ebf00a.tar.gz | |
Generate usage message from comments in the .rst.
Diffstat (limited to 'src/mkusage.pl')
| -rw-r--r-- | src/mkusage.pl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mkusage.pl b/src/mkusage.pl new file mode 100644 index 0000000..d8a5c77 --- /dev/null +++ b/src/mkusage.pl @@ -0,0 +1,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"; |
