Fix ctl control-config not being recognized

When parsing using the .argv interface to yargs the parser state is not
restored back to its pre-parsing state after the operation completes.
This causes a susequent reparse with argv to forget its commands and
respond with an unknown arguments error when trying to use the
control-config command to clusterioctl.  Fix by switching to use the
parse() interface which does restore the parser state after completing.
This commit is contained in:
Hornwitser committed 2021-01-04 08:22:05 +01:00
1 parent 3592ff3269
commit b89688597a
1 file changed
+2 -2
+2 -2
View File
@@ -659,7 +659,7 @@ async function startControl() {
; ;
// Parse the args first to get the configured plugin list. // Parse the args first to get the configured plugin list.
let args = yargs.argv; let args = yargs.parse();
// Log stream for the ctl session. // Log stream for the ctl session.
logger.add(new ConsoleTransport({ logger.add(new ConsoleTransport({
@@ -722,7 +722,7 @@ async function startControl() {
args = yargs args = yargs
.help() .help()
.strict() .strict()
.argv .parse()
; ;
logger.verbose(`Loading config from ${args.config}`); logger.verbose(`Loading config from ${args.config}`);