mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[5422] template generator added
This commit is contained in:
1
tools/cmd-docgen/.gitignore
vendored
Normal file
1
tools/cmd-docgen/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.json
|
@@ -131,15 +131,18 @@ public:
|
|||||||
f << " <title>API Reference</title>" << endl;
|
f << " <title>API Reference</title>" << endl;
|
||||||
|
|
||||||
// Generate initial list of commands
|
// Generate initial list of commands
|
||||||
f << " <para>Kea currently supports " << cmds_.size() << " commands:" << endl
|
f << " <para>Kea currently supports " << cmds_.size() << " commands:" << endl;
|
||||||
<< " <orderedlist>" << endl;
|
|
||||||
|
|
||||||
|
bool first = true;
|
||||||
for (auto cmd : cmds_) {
|
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.
|
// Generate actual commands references.
|
||||||
generateCommands(f);
|
generateCommands(f);
|
||||||
|
18
tools/cmd-docgen/generate-templates
Executable file
18
tools/cmd-docgen/generate-templates
Executable file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/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
|
Reference in New Issue
Block a user