@oclif/core 0.5.37 → 0.5.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.5.38](https://github.com/oclif/core/compare/v0.5.37...v0.5.38) (2021-09-15)
6
+
7
+
8
+ ### Features
9
+
10
+ * have --json global flag disabled by default ([#252](https://github.com/oclif/core/issues/252)) ([c2a7799](https://github.com/oclif/core/commit/c2a7799ce036697c77917a830a12bce5db6c68a7))
11
+
5
12
  ### [0.5.37](https://github.com/oclif/core/compare/v0.5.36...v0.5.37) (2021-09-15)
6
13
 
7
14
 
package/lib/command.d.ts CHANGED
@@ -54,7 +54,7 @@ export default abstract class Command {
54
54
  */
55
55
  static examples: Interfaces.Example[];
56
56
  static parserOptions: {};
57
- static disableJsonFlag: boolean | undefined;
57
+ static enableJsonFlag: boolean;
58
58
  /**
59
59
  * instantiate and run the command
60
60
  * @param {Interfaces.Command.Class} this Class
package/lib/command.js CHANGED
@@ -38,7 +38,7 @@ class Command {
38
38
  return this._flags;
39
39
  }
40
40
  static set flags(flags) {
41
- this._flags = this.disableJsonFlag || settings_1.settings.disableJsonFlag ? flags : Object.assign({}, Command.globalFlags, flags);
41
+ this._flags = this.enableJsonFlag || settings_1.settings.enableJsonFlag ? Object.assign({}, Command.globalFlags, flags) : flags;
42
42
  }
43
43
  get ctor() {
44
44
  return this.constructor;
@@ -81,7 +81,7 @@ class Command {
81
81
  }
82
82
  }
83
83
  jsonEnabled() {
84
- return !this.ctor.disableJsonFlag && this.argv.includes('--json');
84
+ return this.ctor.enableJsonFlag && this.argv.includes('--json');
85
85
  }
86
86
  async init() {
87
87
  this.debug('init version: %s argv: %o', this.ctor._base, this.argv);
@@ -149,6 +149,7 @@ Command.aliases = [];
149
149
  Command.strict = true;
150
150
  Command.parse = true;
151
151
  Command.parserOptions = {};
152
+ Command.enableJsonFlag = false;
152
153
  // eslint-disable-next-line valid-jsdoc
153
154
  /**
154
155
  * instantiate and run the command
package/lib/settings.d.ts CHANGED
@@ -31,8 +31,8 @@ export declare type Settings = {
31
31
  */
32
32
  tsnodeEnabled?: boolean;
33
33
  /**
34
- * Disable the --json flag for all commands
34
+ * Enable the --json flag for all commands
35
35
  */
36
- disableJsonFlag?: boolean;
36
+ enableJsonFlag?: boolean;
37
37
  };
38
38
  export declare const settings: Settings;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@oclif/core",
3
3
  "description": "base library for oclif CLIs",
4
- "version": "0.5.37",
4
+ "version": "0.5.38",
5
5
  "author": "Jeff Dickey @jdxcode",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {