diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:15:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:15:43 +0000 |
commit | f5f56e1a1c4d9e9496fcb9d81131066a964ccd23 (patch) | |
tree | 49e44c6f87febed37efb953ab5485aa49f6481a7 /src/share/api/generate-templates | |
parent | Initial commit. (diff) | |
download | isc-kea-f5f56e1a1c4d9e9496fcb9d81131066a964ccd23.tar.xz isc-kea-f5f56e1a1c4d9e9496fcb9d81131066a964ccd23.zip |
Adding upstream version 2.4.1.upstream/2.4.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/share/api/generate-templates')
-rwxr-xr-x | src/share/api/generate-templates | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/share/api/generate-templates b/src/share/api/generate-templates new file mode 100755 index 0000000..1bfc9ec --- /dev/null +++ b/src/share/api/generate-templates @@ -0,0 +1,43 @@ +#!/bin/sh + +# This script generates API documentation templates. +# Usage: +# +# ./generate-templates cmd... +# +# Arguments are a list of new commands. +# The templates will be created in local directory. + +if [ $# -eq 0 ]; then + echo "Usage: ./generate-templates cmd..." + exit +fi + +while [ $# -ne 0 ]; do + CMD="$1" + shift + F=$CMD.json + + if [ -e "$F" ]; then + echo "$F exists, skipping" + continue; + fi + echo "{" > "$F" + + echo " \"name\": \"$CMD\"," >> "$F" + echo " \"brief\": [ \"a sentence or two explaining what this command does\" ]," >> "$F" + echo " \"description\": [ \"See <xref linkend=\\\"cmd-$LINE\\\"/>\" ]," >> "$F" + echo " \"support\": [ \"undocumented\" ]," >> "$F" + echo " \"avail\": \"0.0.0\"," >> "$F" + echo " \"hook\": \"undocumented\"," >> "$F" + echo " \"access\": \"write\"," >> $F + + echo " \"cmd-syntax\": [ \"Syntax of the command\" ]," >> "$F" + echo " \"cmd-comment\": [ \"Possibly some extra comments after the syntax.\" ]," >> "$F" + + echo " \"resp-syntax\": [ \"Syntax of the response\" ]," >> "$F" + echo " \"resp-comment\": [ \"Optional extra comments after the response syntax.\" ]" >> "$F" + echo "}" >> "$F" + + echo "$CMD generated." +done |