Skip to content

Commit fb23f77

Browse files
committed
fix command doc generator (fixes #177)
fixes wrong arguments for the commands: - DEL_DOWNTIME_BY_START_TIME_COMMENT - ENABLE_EVENT_HANDLERS
1 parent 2289fc5 commit fb23f77

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/documentation/developer/externalcommands/commands.data.mts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ async function getCommands(): Promise<Command[]> {
7777

7878
const matches = line.match(/command_create\s*\(\s*\"([^,]+)\"\s*,([^,]+),\s*"([^"]*)"\s*,\s*([^,]+)\)/);
7979
if (matches) {
80+
lastCommand = {} as Command;
81+
lastCommand.args = [];
82+
8083
lastCommand.name = matches[1].trim();
8184
lastCommand.description = matches[3].trim();
8285
data.push(lastCommand);
@@ -87,9 +90,6 @@ async function getCommands(): Promise<Command[]> {
8790
lastCommand.args.push({ name: a[1].trim(), type: a[0].trim() });
8891
}
8992
}
90-
91-
lastCommand = {} as Command;
92-
lastCommand.args = [];
9393
}
9494
const argmatches = line.match(/command_argument_add\s*\(([^,]+)\s*,\s*\"([^,]+)\"\s*,\s*([^,]+)\s*,\s*([^,]+)/);
9595
if (argmatches) {
@@ -274,4 +274,4 @@ export default {
274274
async load() {
275275
return await getCommands();
276276
}
277-
}
277+
}

src/documentation/developer/externalcommands/del_downtime_by_host_name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ aside: false
99
---
1010

1111
<script setup>
12-
const command = {"args":[],"name":"DEL_DOWNTIME_BY_HOST_NAME","description":"This command deletes all downtimes matching the specified filters.","classes":["host","downtime"],"commandType":4,"argsStr":"","exampleArgStr":""};
12+
const command = {"args":[{"name":"hostname","type":"STRING"},{"name":"service_description","type":"STRING"},{"name":"downtime_start_time","type":"TIMESTAMP"},{"name":"comment","type":"STRING"}],"name":"DEL_DOWNTIME_BY_HOST_NAME","description":"This command deletes all downtimes matching the specified filters.","classes":["host","downtime"],"commandType":4,"argsStr":";hostname;service_description;downtime_start_time;comment","exampleArgStr":";host1;service1;1478648441;This is an example comment."};
1313
</script>
1414

1515
<h3>{{ command.name.replace(/_/g, " ") }}</h3>

src/documentation/developer/externalcommands/del_downtime_by_hostgroup_name.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ aside: false
99
---
1010

1111
<script setup>
12-
const command = {"args":[{"name":"hostname","type":"STRING"},{"name":"service_description","type":"STRING"},{"name":"downtime_start_time","type":"TIMESTAMP"},{"name":"comment","type":"STRING"}],"name":"DEL_DOWNTIME_BY_HOSTGROUP_NAME","description":"This command deletes all downtimes matching the specified filters.","classes":["hostgroup","downtime"],"commandType":5,"argsStr":";hostname;service_description;downtime_start_time;comment","exampleArgStr":";host1;service1;1478648441;This is an example comment."};
12+
const command = {"args":[{"name":"hostgroup_name","type":"HOSTGROUP"},{"name":"hostname","type":"STRING"},{"name":"service_description","type":"STRING"},{"name":"downtime_start_time","type":"TIMESTAMP"},{"name":"comment","type":"STRING"}],"name":"DEL_DOWNTIME_BY_HOSTGROUP_NAME","description":"This command deletes all downtimes matching the specified filters.","classes":["hostgroup","downtime"],"commandType":5,"argsStr":";hostgroup_name;hostname;service_description;downtime_start_time;comment","exampleArgStr":";hostgroup1;host1;service1;1478648441;This is an example comment."};
1313
</script>
1414

1515
<h3>{{ command.name.replace(/_/g, " ") }}</h3>

src/documentation/developer/externalcommands/del_downtime_by_start_time_comment.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ aside: false
99
---
1010

1111
<script setup>
12-
const command = {"args":[{"name":"hostgroup_name","type":"HOSTGROUP"},{"name":"hostname","type":"STRING"},{"name":"service_description","type":"STRING"},{"name":"downtime_start_time","type":"TIMESTAMP"},{"name":"comment","type":"STRING"}],"name":"DEL_DOWNTIME_BY_START_TIME_COMMENT","description":"This command deletes all downtimes matching the specified filters.","classes":["downtime"],"argsStr":";hostgroup_name;hostname;service_description;downtime_start_time;comment","exampleArgStr":";hostgroup1;host1;service1;1478648441;This is an example comment."};
12+
const command = {"args":[{"name":"downtime_start_time","type":"TIMESTAMP"},{"name":"comment","type":"STRING"}],"name":"DEL_DOWNTIME_BY_START_TIME_COMMENT","description":"This command deletes all downtimes matching the specified filters.","classes":["downtime"],"argsStr":";downtime_start_time;comment","exampleArgStr":";1478648441;This is an example comment."};
1313
</script>
1414

1515
<h3>{{ command.name.replace(/_/g, " ") }}</h3>

src/documentation/developer/externalcommands/enable_event_handlers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ aside: false
99
---
1010

1111
<script setup>
12-
const command = {"args":[{"name":"downtime_start_time","type":"TIMESTAMP"},{"name":"comment","type":"STRING"}],"name":"ENABLE_EVENT_HANDLERS","description":"Enables host and service event handlers on a program-wide basis.","classes":["comment"],"argsStr":";downtime_start_time;comment","exampleArgStr":";1478648441;This is an example comment."};
12+
const command = {"args":[],"name":"ENABLE_EVENT_HANDLERS","description":"Enables host and service event handlers on a program-wide basis.","classes":["process"],"argsStr":"","exampleArgStr":""};
1313
</script>
1414

1515
<h3>{{ command.name.replace(/_/g, " ") }}</h3>

0 commit comments

Comments
 (0)