From adf34240d9091e520556ec48f48bb09f42b4a386 Mon Sep 17 00:00:00 2001 From: kyli Date: Wed, 21 Feb 2024 17:51:40 +0800 Subject: [PATCH] fix: help --- packages/solutions/app-tools/src/index.ts | 1 + packages/solutions/module-tools/src/command.ts | 1 + packages/solutions/monorepo-tools/src/cli/upgrade.ts | 1 + packages/toolkit/upgrade/src/index.ts | 2 ++ 4 files changed, 5 insertions(+) diff --git a/packages/solutions/app-tools/src/index.ts b/packages/solutions/app-tools/src/index.ts index 7eb3d9dd34c6..46336c9fd242 100644 --- a/packages/solutions/app-tools/src/index.ts +++ b/packages/solutions/app-tools/src/index.ts @@ -281,6 +281,7 @@ export const appTools = ( program .command('upgrade') .allowUnknownOption() + .option('-h --help', 'Show help') // In order to upgrade help work. .action(async () => { await upgradeAction(); }); diff --git a/packages/solutions/module-tools/src/command.ts b/packages/solutions/module-tools/src/command.ts index 16338a3290cd..612c284de89c 100644 --- a/packages/solutions/module-tools/src/command.ts +++ b/packages/solutions/module-tools/src/command.ts @@ -109,6 +109,7 @@ export const upgradeCommand = async (program: Command) => { program .command('upgrade') .allowUnknownOption() + .option('-h --help', 'Show help') // In order to upgrade help work. .action(async () => { await upgradeAction(); }); diff --git a/packages/solutions/monorepo-tools/src/cli/upgrade.ts b/packages/solutions/monorepo-tools/src/cli/upgrade.ts index 98d6cf4966ad..9839e5a4e830 100644 --- a/packages/solutions/monorepo-tools/src/cli/upgrade.ts +++ b/packages/solutions/monorepo-tools/src/cli/upgrade.ts @@ -5,6 +5,7 @@ export const upgradeCli = (program: Command) => { program .command('upgrade') .allowUnknownOption() + .option('-h --help', 'Show help') // In order to upgrade help work. .action(async () => { await upgradeAction(); }); diff --git a/packages/toolkit/upgrade/src/index.ts b/packages/toolkit/upgrade/src/index.ts index 58d68e2a4d32..214614237a49 100644 --- a/packages/toolkit/upgrade/src/index.ts +++ b/packages/toolkit/upgrade/src/index.ts @@ -9,7 +9,9 @@ export function defineCommand(program: Command) { const locale = getLocaleLanguage(); i18n.changeLanguage({ locale }); program + .alias('upgrade') .description(i18n.t(localeKeys.command.describe)) + .usage('npx @modern-js/upgrade [options]') .option('-c --config ', i18n.t(localeKeys.command.config)) .option('--dist-tag ', i18n.t(localeKeys.command.distTag), '') .option('--registry ', i18n.t(localeKeys.command.registry), '')