From 927bce2ee2bd23790c7f6cef9be4cb96d1e0b99a Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Sat, 27 Jun 2020 14:23:15 +0530 Subject: [PATCH] fix: prevent default behavior of arg-parser lib --- packages/webpack-cli/lib/utils/arg-parser.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/webpack-cli/lib/utils/arg-parser.js b/packages/webpack-cli/lib/utils/arg-parser.js index e196ae2c1aa..9c55d9988e4 100644 --- a/packages/webpack-cli/lib/utils/arg-parser.js +++ b/packages/webpack-cli/lib/utils/arg-parser.js @@ -70,10 +70,10 @@ function argParser(options, args, argsOnly = false, name = '', helpFunction = un let flagsWithType = option.type !== Boolean ? flags + ' ' : flags; if (option.type === Boolean || option.type === String) { if (!option.multiple) { - parserInstance.option(flagsWithType, option.description, option.defaultValue); + parserInstance.option(flagsWithType, option.description, option.defaultValue).action(() => {}); } else { const multiArg = (value, previous = []) => previous.concat([value]); - parserInstance.option(flagsWithType, option.description, multiArg, option.defaultValue); + parserInstance.option(flagsWithType, option.description, multiArg, option.defaultValue).action(() => {}); } } else if (option.type === Number) { parserInstance.option(flagsWithType, option.description, Number, option.defaultValue); @@ -81,9 +81,9 @@ function argParser(options, args, argsOnly = false, name = '', helpFunction = un // in this case the type is a parsing function if (option.type.length > 1) { flagsWithType = flags + ' [value]'; - parserInstance.option(flagsWithType, option.description, option.type[0], option.defaultValue); + parserInstance.option(flagsWithType, option.description, option.type[0], option.defaultValue).action(() => {}); } else { - parserInstance.option(flagsWithType, option.description, option.type, option.defaultValue); + parserInstance.option(flagsWithType, option.description, option.type, option.defaultValue).action(() => {}); } }