Skip to content

Commit

Permalink
feat: improve help output
Browse files Browse the repository at this point in the history
  • Loading branch information
snitin315 committed Jul 6, 2020
1 parent 914409e commit afadcd1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
11 changes: 11 additions & 0 deletions packages/webpack-cli/lib/groups/HelpGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ class HelpGroup {
const { underline, bold } = chalk.white;
const o = (s) => chalk.keyword('orange')(s);
const options = require('../utils/cli-flags');
const negatedFlags = options.core.filter((flag) => flag.negative === true);
const title = bold('⬡ ') + underline('webpack') + bold(' ⬡');
const desc = 'The build tool for modern web applications';
const websitelink = ' ' + underline('https://webpack.js.org');
Expand Down Expand Up @@ -115,6 +116,16 @@ class HelpGroup {
return e;
}),
},
{
header: 'Negated Flags',
optionList: negatedFlags.map((e) => {
e.description = `Negates ${e.name}`;
e.name = `no-${e.name}`;
e.alias = null;
e.type = Boolean;
return e;
}),
},
]);
return {
outputOptions: {
Expand Down
16 changes: 0 additions & 16 deletions packages/webpack-cli/lib/utils/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,14 +160,6 @@ module.exports = {
description: 'Enables Hot Module Replacement',
link: 'https://webpack.js.org/concepts/hot-module-replacement/',
},
{
name: 'no-hot',
usage: '--no-hot',
type: Boolean,
group: ADVANCED_GROUP,
description: 'Disables Hot Module Replacement',
link: 'https://webpack.js.org/concepts/hot-module-replacement/',
},
{
name: 'sourcemap',
usage: '--sourcemap <sourcemap | eval>',
Expand Down Expand Up @@ -247,14 +239,6 @@ module.exports = {
description: 'It instructs webpack on how to treat the stats e.g. verbose',
link: 'https://webpack.js.org/configuration/stats/#stats',
},
{
name: 'no-stats',
usage: '--no-stats',
type: Boolean,
group: DISPLAY_GROUP,
description: 'Disables stats output',
link: 'https://webpack.js.org/configuration/stats/#stats',
},
{
name: 'verbose',
usage: '--verbose',
Expand Down

0 comments on commit afadcd1

Please sign in to comment.