From b89688597aa97d69690138d8a934d3c30e86997c Mon Sep 17 00:00:00 2001 From: Hornwitser Date: Mon, 4 Jan 2021 08:13:16 +0100 Subject: [PATCH] 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. --- packages/ctl/ctl.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ctl/ctl.js b/packages/ctl/ctl.js index 0f71dcd4..6b982e94 100755 --- a/packages/ctl/ctl.js +++ b/packages/ctl/ctl.js @@ -659,7 +659,7 @@ async function startControl() { ; // Parse the args first to get the configured plugin list. - let args = yargs.argv; + let args = yargs.parse(); // Log stream for the ctl session. logger.add(new ConsoleTransport({ @@ -722,7 +722,7 @@ async function startControl() { args = yargs .help() .strict() - .argv + .parse() ; logger.verbose(`Loading config from ${args.config}`);