Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cli): show help flag when defaults fail #466

Merged
merged 11 commits into from
Jun 2, 2018
5 changes: 3 additions & 2 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
const chalk = require("chalk");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't have chalk here. Leave it unstyled for now


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to trim here

(function() {
// wrap in IIFE to be able to use return
Expand Down Expand Up @@ -501,8 +502,8 @@ For more information, see https://webpack.js.org/api/cli/.`);
if (errors[0].name === "EntryModuleNotFoundError") {
stdout.write("\n" + chalk.red(errors[0].error.toString()) + "\n");
stdout.write(
"\n" + " ERROR Insufficient number of arguments provided " +
"\n" + " INFO Alternatively, run `webpack(-cli) --help` for usage info." +
"\n" + chalk.blue("ERROR ") + "Insufficient number of arguments provided " +
"\n" + chalk.blue("INFO ") + "Alternatively, run `webpack(-cli) --help` for usage info." +
"\n\n"
);
process.exit(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should exit the process now as we've got no styling

Expand Down