Skip to content

Commit

Permalink
Rename --info -> --env-info
Browse files Browse the repository at this point in the history
  • Loading branch information
kaicataldo committed Sep 17, 2019
1 parent 86c4f5b commit 21edd78
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/user-guide/command-line-interface.md
Expand Up @@ -78,7 +78,7 @@ Caching:
Miscellaneous:
--init Run config initialization wizard - default: false
--info Output execution environment information - default: false
--env-info Output execution environment information - default: false
--debug Output debugging information
-h, --help Show help
-v, --version Output the version number
Expand Down Expand Up @@ -447,7 +447,7 @@ This option will start config initialization wizard. It's designed to help new u

The resulting configuration file will be created in the current directory.

#### `--info`
#### `--env-info`

This option outputs information about the execution environment, including the version of Node, npm, and local and global installations of ESLint. The ESLint team may ask for this information to help solve bugs.

Expand Down
2 changes: 1 addition & 1 deletion lib/cli.js
Expand Up @@ -164,7 +164,7 @@ const cli = {

if (currentOptions.version) {
log.info(RuntimeInfo.version());
} else if (currentOptions.info) {
} else if (currentOptions.envInfo) {
try {
log.info(RuntimeInfo.environment());
return 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/options.js
Expand Up @@ -225,7 +225,7 @@ module.exports = optionator({
description: "Run config initialization wizard"
},
{
option: "info",
option: "env-info",
type: "Boolean",
default: "false",
description: "Output execution environment information"
Expand Down
6 changes: 3 additions & 3 deletions tests/lib/cli.js
Expand Up @@ -332,16 +332,16 @@ describe("cli", () => {
});
});

describe("when executing with info flag", () => {
describe("when executing with env-info flag", () => {
it("should print out environment information", () => {
assert.strictEqual(cli.execute("--info"), 0);
assert.strictEqual(cli.execute("--env-info"), 0);
assert.strictEqual(log.info.callCount, 1);
});

it("should print error message and return error code", () => {
RuntimeInfo.environment.throws("There was an error!");

assert.strictEqual(cli.execute("--info"), 2);
assert.strictEqual(cli.execute("--env-info"), 2);
assert.strictEqual(log.error.callCount, 1);
});
});
Expand Down

0 comments on commit 21edd78

Please sign in to comment.