Skip to content

Commit 37aa9a6

Browse files
authored
Merge pull request webpack#3212 from webpack/fix-version-cli
Fix using --version and -v
2 parents 9badd0e + aed548b commit 37aa9a6

2 files changed

Lines changed: 3 additions & 19 deletions

File tree

bin/config-yargs.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ module.exports = function(yargs) {
1010
yargs
1111
.help("help")
1212
.alias("help", "h", "?")
13+
.version()
14+
.alias("version", "v")
1315
.options({
1416
"config": {
1517
type: "string",
@@ -22,12 +24,6 @@ module.exports = function(yargs) {
2224
describe: "Enviroment passed to the config, when it is a function",
2325
group: CONFIG_GROUP
2426
},
25-
"version": {
26-
type: "string",
27-
describe: "Webpack version",
28-
alias: "v",
29-
group: BASIC_GROUP,
30-
},
3127
"context": {
3228
type: "string",
3329
describe: "The root directory for resolving entry point and stats",

bin/convert-argv.js

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,10 @@ var interpret = require("interpret");
66
var WebpackOptionsDefaulter = require("../lib/WebpackOptionsDefaulter");
77
var validateWebpackOptions = require("../lib/validateWebpackOptions");
88

9-
module.exports = function(optimist, argv, convertOptions) {
9+
module.exports = function(yargs, argv, convertOptions) {
1010

1111
var options = [];
1212

13-
// Help
14-
if(argv.help) {
15-
optimist.showHelp();
16-
process.exit(0); // eslint-disable-line
17-
}
18-
19-
// Version
20-
if(argv.v || argv.version) {
21-
console.log(require("../package.json").version);
22-
process.exit(0); // eslint-disable-line
23-
}
24-
2513
// Shortcuts
2614
if(argv.d) {
2715
argv.debug = true;

0 commit comments

Comments
 (0)