Skip to content

Commit

Permalink
chore: add descriptions for options
Browse files Browse the repository at this point in the history
  • Loading branch information
rishabh3112 committed Feb 24, 2020
1 parent f8a52ec commit 55ca8ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
5 changes: 3 additions & 2 deletions packages/webpack-cli/lib/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const WebpackCLI = require('./webpack-cli');
const { core, commands } = require('./utils/cli-flags');
const logger = require('./utils/logger');
const cliExecuter = require('./utils/cli-executer');

require('./utils/process-log');

Expand Down Expand Up @@ -68,8 +69,8 @@ async function runCLI(cli, commandIsUsed) {
.forEach(unknown => {
logger.warn('Unknown argument:', unknown);
});
// return cli.runHelp(process.argv);
return;
cliExecuter();
return;
}
const result = await cli.run(args, core);
if (!result) {
Expand Down
11 changes: 7 additions & 4 deletions packages/webpack-cli/lib/utils/cli-executer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { MultiSelect, Input} = require('enquirer');
const { MultiSelect, Input } = require('enquirer');
const runner = require('../runner');
const logger = require('./logger');
const cliArgs = require('./cli-flags').core;
Expand All @@ -10,8 +10,11 @@ async function prompter() {
name: 'type',
message: 'Which flags do you want to use?',
choices: cliArgs.reduce((prev, curr) => {
return [...prev, `--${curr.name}`];
}, [])
return [...prev, `--${curr.name}: ${curr.description}`];
}, []),
result: (value) => {
return value.map((flag) => flag.split(":")[0]);
}
});

const selections = await typePrompt.run();
Expand Down Expand Up @@ -53,4 +56,4 @@ async function run() {
runner([], args);
}

run();
module.exports = run;

0 comments on commit 55ca8ec

Please sign in to comment.