Version 2.19.
[pwmd.git] / doc / extract-help-text.awk
blobf50a86032823441cbdd76e6d3226c308937be3f4
1 # Read in commands.c to reformat the command help text for offline
2 # documentation found in doc/COMMANDS.
4 while (getline > 0)
5 if ($0 ~ /!BEGIN-HELP-TEXT!/) {
6 while (getline > 0)
7 if ($0 ~ /!END-HELP-TEXT!/) {
8 exit
10 else if ($0 ~ /new_command\(/) {
11 getline
12 sub(/^\"/,"")
13 sub(/\\n\"$/,"")
14 print
16 while (getline > 0)
17 if ($0 ~ /^\)\);/) {
18 print "\n"
19 break
21 else {
22 sub(/^\"/,"")
23 sub(/\\n\"$/,"")
24 gsub(/\\\"/,"\"")
25 print