From 1d157535f22a8cb8f31511472ff4fa109fe2414b Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Mon, 16 Oct 2023 18:27:20 +0700 Subject: [PATCH] fix(developer): kmc crash on start Fixes #9766. The issue arose because commander passes different parameters to the callback depending on the spec of the command. Very fragile! --- developer/src/kmc/src/commands/analyze.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/developer/src/kmc/src/commands/analyze.ts b/developer/src/kmc/src/commands/analyze.ts index e878cc49221..eb2feb528ab 100644 --- a/developer/src/kmc/src/commands/analyze.ts +++ b/developer/src/kmc/src/commands/analyze.ts @@ -21,13 +21,13 @@ interface AnalysisActivityOptions /* not inheriting from CompilerBaseOptions */ }; export function declareAnalyze(program: Command) { - let command = program.command('analyze [infile...]'); + let command = program.command('analyze'); declareOskCharUse(command); declareOskRewrite(command); } function declareOskCharUse(command: Command) { - let subCommand = command.command('osk-char-use'); + let subCommand = command.command('osk-char-use [infile...]'); BaseOptions.addLogLevel(subCommand); subCommand .description('Analyze On Screen Keyboards for character usage') @@ -52,7 +52,7 @@ function declareOskCharUse(command: Command) { } function declareOskRewrite(command: Command) { - let subCommand = command.command('osk-rewrite-from-char-use'); + let subCommand = command.command('osk-rewrite-from-char-use [infile...]'); subCommand .description('Rewrite On Screen Keyboard files from source mapping; given file.ext, output is written to file-pua.ext') .addOption(new Option('-m, --mapping-file ', 'JSON mapping file to read from').makeOptionMandatory())