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);
--- /dev/null
+#!/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