Describe the bug
Presently thrown err are simply logged in case of unknown flag, maybe we can present it nicely and show a message to use help flag for proper usage
What is the current behavior?
Stacktrace is printed in case of unknown flag.
To Reproduce
Invoke cli with an unknown flag
Expected behavior
concise message of supplying an unknown flag should be displayed. something like -

Screenshots
If applicable, add screenshots to help explain your problem.

Please paste the results of webpack-cli info here, and mention other relevant information
Additional context
Looking for feedback on this before starting work.
@evenstensberg @ematipico @rishabh3112 thoughts are appreciated. ๐
Yep we definitely need to do this
On it then!
baller af
โ webpack-cli git:(next) webpack-cli --init
โฌข webpack: Unknown argument: --init
Compilation Results
Version: 5.0.0-beta.12
Built: Thu Jan 23 2020 21:39:54 GMT+0530 (India Standard Time)
Compile Time: 186ms
Output Directory: /home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/dist
โโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโ
โ Bundle emitted โ Bundle name โ Bundle size โ
โโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโค
โ failed โ main.js โ 0.00 kb โ
โโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโ
โฌข webpack: configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
โฌข webpack: NoModeWarning: configuration
The 'mode' option has not been set, webpack will fallback to 'production' for this value. Set 'mode' option to 'development' or 'production' to enable defaults for each environment.
You can also set it to 'none' to disable any default behavior. Learn more: https://webpack.js.org/configuration/mode/
at /home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/lib/WarnNoModeSetPlugin.js:20:30
at Hook.eval [as call] (eval at create (/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:13:1)
at Hook.CALL_DELEGATE [as _call] (/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/node_modules/tapable/lib/Hook.js:14:14)
at Compiler.newCompilation (/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/lib/Compiler.js:857:30)
at /home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/lib/Compiler.js:898:29
at Hook.eval [as callAsync] (eval at create (/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/node_modules/tapable/lib/Hook.js:18:14)
at Compiler.compile (/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/lib/Compiler.js:893:28)
at /home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/lib/Compiler.js:424:12
at Compiler.readRecords (/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli/node_modules/webpack/lib/Compiler.js:736:11)
โฌข webpack: Module not found: Error: Can't resolve './src' in '/home/james-the-hacker/CodeSpace/GitHub-Projects/webpack-cli'
\cc @ematipico
@jamesgeorge007 could you please argument your comment? I don't understand why ๐
Oops!
Passing in an unknown flag results in the logs as given above in my case. We can avoid those unnecessary logs by performing an exit here:-
https://github.com/webpack/webpack-cli/blob/a0ac134ff0d0a17c10387da99f5e96443e48bb15/lib/bootstrap.js#L69
What about passing a valid flag then an unvalid flag?
I think we can execute for the valid flag and log about the other parameter being invalid.
Can do whatever everyone agrees with. โจ
Most helpful comment
baller af