Use factory pattern for yargs

The ESM import of yargs does not support the singleton way of using
yargs, instead we have to call the yargs function to get a parser that
can be augmented with the options.

The .argv property has also been deprecated. Replace it with a call to
.parse() instead.
This commit is contained in:
Hornwitser committed 2026-09-11 19:51:15 +02:00
1 parent 7987a5d925
commit d6dce12acc
4 files changed
+8 -8

No files matched your search

+2 -2
View File
@@ -268,7 +268,7 @@ interface InitializeParameters {
async function initialize(): Promise<InitializeParameters> {
// argument parsing
const args = await yargs
const args = await yargs(process.argv.slice(2))
.scriptName("controller")
.usage("$0 <command> [options]")
.option("log-level", {
@@ -340,7 +340,7 @@ async function initialize(): Promise<InitializeParameters> {
})
.demandCommand(1, "You need to specify a command to run")
.strict()
.argv
.parse()
;
// Combined log stream of the whole cluster.