From 93520270f4bfdbf1b70ed3f02e8fe34fae51e246 Mon Sep 17 00:00:00 2001 From: James George Date: Tue, 23 Jun 2020 19:06:06 +0530 Subject: [PATCH] feat: add aliases to all available commands (#1644) * feat: show up command aliases as part of help info * feat: add aliases for all available commands * refactor: remove ternary --- packages/webpack-cli/lib/groups/HelpGroup.js | 4 ++-- packages/webpack-cli/lib/utils/cli-flags.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/webpack-cli/lib/groups/HelpGroup.js b/packages/webpack-cli/lib/groups/HelpGroup.js index 5e21c3e9ab8..571b2608d20 100644 --- a/packages/webpack-cli/lib/groups/HelpGroup.js +++ b/packages/webpack-cli/lib/groups/HelpGroup.js @@ -102,8 +102,8 @@ class HelpGroup { }, { header: 'Available Commands', - content: options.commands.map((e) => { - return { name: e.name, summary: e.description }; + content: options.commands.map((cmd) => { + return { name: `${cmd.name} | ${cmd.alias}`, summary: cmd.description }; }), }, { diff --git a/packages/webpack-cli/lib/utils/cli-flags.js b/packages/webpack-cli/lib/utils/cli-flags.js index 4c85a6547f9..6b3e4f7cb4a 100644 --- a/packages/webpack-cli/lib/utils/cli-flags.js +++ b/packages/webpack-cli/lib/utils/cli-flags.js @@ -26,6 +26,7 @@ module.exports = { }, { name: 'migrate', + alias: 'm', type: String, usage: 'migrate', description: 'Migrate a configuration to a new version', @@ -49,6 +50,7 @@ module.exports = { { name: 'info', scope: 'external', + alias: 'i', type: String, usage: 'info [options]', description: 'Outputs information about your system and dependencies', @@ -63,6 +65,7 @@ module.exports = { }, { name: 'serve', + alias: 's', scope: 'external', type: String, usage: 'serve',