🧑‍💻 show a configuration summary when starting cli (#438)

This commit is contained in:
Eric Doughty-Papassideris
2024-03-26 12:06:22 +01:00
committed by ericlinagora
parent f786d464ff
commit 9a05e9cf23
2 changed files with 122 additions and 0 deletions
+13
View File
@@ -1,6 +1,7 @@
import "reflect-metadata";
import yargs from "yargs";
import { logger } from "../core/platform/framework/logger";
import printConfigSummary from "./lib/print_config_summary";
process.env.NODE_ENV = "cli";
@@ -10,6 +11,10 @@ yargs
.middleware([
argv => {
logger.level = argv.verbose ? "debug" : "fatal";
if (!argv.quietConfigSummary) {
console.error("Platform configuration:");
printConfigSummary().forEach(x => console.error(`\t${x}`));
}
},
])
.commandDir("cmds", {
@@ -20,6 +25,14 @@ yargs
default: false,
type: "boolean",
description: "Run with verbose logging",
group: "Output",
})
.option("quietConfigSummary", {
alias: "q",
default: false,
type: "boolean",
description: "Do not print the configuration summary at startup",
group: "Output",
})
.demandCommand(1, "Please supply a valid command")
.alias("help", "h")