Skip to content

Commit

Permalink
cli(cmds): revise yargs command (#422)
Browse files Browse the repository at this point in the history
* use yargs.command instead of yargs.option for sub-commands

* cli(node): Add node flags to CLI (#377)

* feat: add support for node flags

* tests: Fix node-flags test

* misc: Fix test failing due to not-found webpack-cli

* misc: remove comment

* misc: refactor removing unecessary args

* tests: add more tests to prevent argument collision

* cli(cmds): remove strict

* fix(node): remove node option for now
  • Loading branch information
evenstensberg committed May 7, 2018
1 parent a6684c6 commit 7becfe6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 49 deletions.
50 changes: 1 addition & 49 deletions bin/config-yargs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const OUTPUT_GROUP = "Output options:";
const ADVANCED_GROUP = "Advanced options:";
const RESOLVE_GROUP = "Resolving options:";
const OPTIMIZE_GROUP = "Optimizing options:";
const INIT_GROUP = "Initialization:";

module.exports = function(yargs) {
yargs
Expand All @@ -15,52 +14,6 @@ module.exports = function(yargs) {
.version()
.alias("version", "v")
.options({
init: {
type: "boolean",
describe:
"Initializes a new webpack configuration or loads a" +
"\n" +
"addon if specified",
group: INIT_GROUP
},
migrate: {
type: "boolean",
describe:
"Migrate your webpack configuration from webpack 1 to webpack 2",
group: INIT_GROUP
},
add: {
type: "boolean",
describe: "Adds a webpack component to your configuration file",
group: INIT_GROUP
},
/*
remove: {
type: "boolean",
describe: "Removes a webpack component to your configuration file",
group: INIT_GROUP
},
update: {
type: "boolean",
describe: "Updates a webpack component to your configuration file",
group: INIT_GROUP
},
make: {
type: "boolean",
describe: "Converts a webpack configuration to a makefile",
group: INIT_GROUP
},
*/
"generate-loader": {
type: "boolean",
describe: "Generates a new webpack loader project",
group: INIT_GROUP
},
"generate-plugin": {
type: "boolean",
describe: "Generates a new webpack plugin project",
group: INIT_GROUP
},
config: {
type: "string",
describe: "Path to the config file",
Expand Down Expand Up @@ -346,6 +299,5 @@ module.exports = function(yargs) {
"shortcut for --optimize-minimize --define process.env.NODE_ENV=\"production\"",
group: BASIC_GROUP
}
})
.strict();
});
};
1 change: 1 addition & 0 deletions bin/webpack.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
Usage: webpack-cli [options]
webpack-cli [options] --entry <entry> --output <output>
webpack-cli [options] <entries...> --output <output>
webpack-cli <command> [options]
For more information, see https://webpack.js.org/api/cli/.`);

Expand Down

0 comments on commit 7becfe6

Please sign in to comment.