Commit c370715f authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[5422] template generator added

parent 49bfad5b
......@@ -131,15 +131,18 @@ public:
f << " <title>API Reference</title>" << endl;
// Generate initial list of commands
f << " <para>Kea currently supports " << cmds_.size() << " commands:" << endl
<< " <orderedlist>" << endl;
f << " <para>Kea currently supports " << cmds_.size() << " commands:" << endl;
bool first = true;
for (auto cmd : cmds_) {
f << " <listitem><simpara>" << cmd.first << "</simpara></listitem>" << endl;
if (!first) {
f << ", ";
}
f << "<command>" << cmd.first << "</command>" << endl;
first = false;
}
f << " </orderedlist>" << endl;
f << " </para>" << endl;
f << ".</para>" << endl;
// Generate actual commands references.
generateCommands(f);
......
#!/bin/bash
while read -r LINE; do
F=$LINE.json
echo "{" > $F
echo " \"name\": \"$LINE\",\n" >> $F
echo " \"brief\": \"a sentence or two explaining what this command does\",\n" >> $F
echo " \"support\": [ \"kea-dhcp4\", \"kea-dhcp6\" ],\n" >> $F
echo " \"avail\": \"first version, possible a hook library name and (premium) if applicable\",\n" >> $F
echo " \"cmd-syntax\": \"Syntax of the command\",\n" >> $F
echo " \"cmd-comment\": \"Possibly some extra comments after the syntax.\",\n" >> $F
echo " \"resp-syntax\": \"Syntax of the response\",\n" >> $F
echo " \"resp-comment\": \"Optional extra comments after the respone syntax.\"\n" >> $F
echo "}" >> $F
echo "$LINE generated."
done < cmds-list
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment