Skip to content

Commit 8a8bc72

Browse files
committed
chore: refactor webpack-cli
1 parent 51af1e1 commit 8a8bc72

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/webpack-cli.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,11 @@ class WebpackCLI extends GroupHelper {
165165
runHelp(args) {
166166
const HelpGroup = require('./groups/help');
167167
const Commands = require('./utils/commands').names;
168-
let command = null;
169-
args.forEach(arg => {
170-
if (Commands.includes(arg)) command = arg;
171-
});
168+
const command = Object.keys(Commands).map( i => {
169+
if (args.includes(Commands[i])) {
170+
return Commands[i];
171+
}
172+
})[0];
172173
return new HelpGroup().outputHelp(command);
173174
}
174175

0 commit comments

Comments
 (0)