@oclif/core 3.10.8 → 3.11.0

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.
@@ -125,8 +125,7 @@ class CommandHelp extends formatter_1.HelpFormatter {
125
125
  let label = flag.helpLabel;
126
126
  if (!label) {
127
127
  const labels = [];
128
- if (flag.char)
129
- labels.push(`-${flag.char[0]}`);
128
+ labels.push(flag.char ? `-${flag.char[0]}` : ' ');
130
129
  if (flag.name) {
131
130
  if (flag.type === 'boolean' && flag.allowNo) {
132
131
  labels.push(`--[no-]${flag.name.trim()}`);
@@ -135,7 +134,7 @@ class CommandHelp extends formatter_1.HelpFormatter {
135
134
  labels.push(`--${flag.name.trim()}`);
136
135
  }
137
136
  }
138
- label = labels.join(', ');
137
+ label = labels.join(flag.char ? ', ' : ' ');
139
138
  }
140
139
  if (flag.type === 'option') {
141
140
  let value = flag.helpValue || (this.opts.showFlagNameInTitle ? flag.name : '<value>');
@@ -153,8 +152,11 @@ class CommandHelp extends formatter_1.HelpFormatter {
153
152
  flags(flags) {
154
153
  if (flags.length === 0)
155
154
  return;
155
+ const noChar = flags.reduce((previous, current) => previous && current.char === undefined, true);
156
156
  return flags.map((flag) => {
157
- const left = this.flagHelpLabel(flag);
157
+ let left = this.flagHelpLabel(flag);
158
+ if (noChar)
159
+ left = left.replace(' ', '');
158
160
  let right = flag.summary || flag.description || '';
159
161
  if (flag.type === 'option' && flag.default) {
160
162
  right = `[default: ${flag.default}] ${right}`;
@@ -176,6 +178,8 @@ class CommandHelp extends formatter_1.HelpFormatter {
176
178
  // Guaranteed to be set because of the filter above, but make ts happy
177
179
  const summary = flag.summary || '';
178
180
  let flagHelp = this.flagHelpLabel(flag, true);
181
+ if (!flag.char)
182
+ flagHelp = flagHelp.replace(' ', '');
179
183
  flagHelp +=
180
184
  flagHelp.length + summary.length + 2 < this.opts.maxWidth
181
185
  ? ' ' + summary
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": "3.10.8",
4
+ "version": "3.11.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/oclif/core/issues",
7
7
  "dependencies": {
@@ -34,17 +34,17 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@commitlint/config-conventional": "^17.7.0",
37
- "@oclif/plugin-help": "^5.2.8",
37
+ "@oclif/plugin-help": "^5.2.20",
38
38
  "@oclif/plugin-plugins": "^3.3.0",
39
39
  "@oclif/prettier-config": "^0.2.1",
40
40
  "@oclif/test": "^3.0.3",
41
41
  "@types/ansi-styles": "^3.2.1",
42
42
  "@types/benchmark": "^2.1.2",
43
- "@types/chai": "^4.3.8",
44
- "@types/chai-as-promised": "^7.1.5",
43
+ "@types/chai": "^4.3.10",
44
+ "@types/chai-as-promised": "^7.1.8",
45
45
  "@types/clean-stack": "^2.1.1",
46
46
  "@types/cli-progress": "^3.11.0",
47
- "@types/debug": "^4.1.10",
47
+ "@types/debug": "^4.1.12",
48
48
  "@types/ejs": "^3.1.3",
49
49
  "@types/indent-string": "^4.0.1",
50
50
  "@types/js-yaml": "^3.12.7",