[mod] main:Aktion "expose-conf" hinzugefügt

This commit is contained in:
roydfalk 2024-04-22 23:38:05 +02:00
parent cfeee83fdb
commit 33339d5700

View file

@ -25,6 +25,10 @@ async function main(
"name": "api-doc", "name": "api-doc",
"description": "API-Dokumentation gemäß OpenAPI Specification auf Standard-Ausgabe schreiben" "description": "API-Dokumentation gemäß OpenAPI Specification auf Standard-Ausgabe schreiben"
}, },
{
"name": "expose-conf",
"description": "Vollständige Konfiguration ausgeben"
},
{ {
"name": "password-image", "name": "password-image",
"description": "Passwort-Abbild errechnen und auf Standard-Ausgabe schreiben" "description": "Passwort-Abbild errechnen und auf Standard-Ausgabe schreiben"
@ -126,9 +130,6 @@ async function main(
] ]
); );
// prepare database
await _espe.database.advance_all();
switch (args["action"]) { switch (args["action"]) {
default: { default: {
process.stderr.write("invalid action: " + args["action"] + "\n"); process.stderr.write("invalid action: " + args["action"] + "\n");
@ -145,6 +146,18 @@ async function main(
} }
break; break;
} }
case "expose-conf": {
process.stdout.write(
JSON.stringify(
_espe.conf.get(),
undefined,
"\t"
)
+
"\n"
);
break;
}
case "api-doc": { case "api-doc": {
const rest_subject : lib_plankton.rest.type_rest = _espe.api.make(); const rest_subject : lib_plankton.rest.type_rest = _espe.api.make();
process.stdout.write( process.stdout.write(
@ -157,6 +170,9 @@ async function main(
break; break;
} }
case "serve": { case "serve": {
// prepare database
await _espe.database.check();
await lib_plankton.session.setup( await lib_plankton.session.setup(
{ {
/* /*