balena-cli 23.1.2-build-remove-help-patch-4a0d00ce703dfb8c6251d5748ae24dc5aa75df3f-1 → 23.1.2-build-fix-not-being-able-to-use-version-and-autocomplete-offline-74f7b5d0fe4bbbf39f7aea381b3c09ff80c9bbcd-1
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 +1 -2
- package/build/app.js +0 -16
- package/build/app.js.map +1 -1
- package/build/help.d.ts +1 -5
- package/build/help.js +0 -24
- package/build/help.js.map +1 -1
- package/build/hooks/prerun.js +4 -2
- package/build/hooks/prerun.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +72 -72
- package/package.json +2 -2
- package/patches/all/@oclif+core+4.5.6.patch +65 -0
- package/src/app.ts +1 -29
- package/src/help.ts +1 -31
- package/src/hooks/prerun.ts +3 -0
package/CHANGELOG.md
CHANGED
|
@@ -6,8 +6,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|
|
6
6
|
|
|
7
7
|
## 23.1.2 - 2025-11-18
|
|
8
8
|
|
|
9
|
-
*
|
|
10
|
-
* help: Replace the oclif patch for hiding subtopics with overrides in the BalenaHelp class [Thodoris Greasidis]
|
|
9
|
+
* Fix `version` and `autocomplete` commands not working without internet [Matthew Yarmolinsky]
|
|
11
10
|
|
|
12
11
|
## 23.1.1 - 2025-11-18
|
|
13
12
|
|
package/build/app.js
CHANGED
|
@@ -77,22 +77,6 @@ async function oclifRun(command, options) {
|
|
|
77
77
|
isEEXIT = true;
|
|
78
78
|
}
|
|
79
79
|
else {
|
|
80
|
-
if (error instanceof core_1.Errors.CLIError) {
|
|
81
|
-
const RequiredArgsErrorRegex = /^Missing (\d+) required arg(s?\b)/;
|
|
82
|
-
if (RequiredArgsErrorRegex.exec(error.message) != null) {
|
|
83
|
-
error.message = error.message
|
|
84
|
-
.split('\n')
|
|
85
|
-
.map((line, i) => {
|
|
86
|
-
if (i === 0) {
|
|
87
|
-
return line.replace(RequiredArgsErrorRegex, 'Missing $1 required argument$2');
|
|
88
|
-
}
|
|
89
|
-
return line.replace(/^(?<argName>[\w-]+)(?<paddingSpaces>[ ]+)[ ](?<description>\w)/, '$<argName>$<paddingSpaces>: $<description>');
|
|
90
|
-
})
|
|
91
|
-
.join('\n');
|
|
92
|
-
const helpCommand = `balena ${command.map((c, i) => (i === 0 ? c.replace(/:/g, ' ') : c)).join(' ')} --help`;
|
|
93
|
-
error.message = error.message.replace('\nSee more help with --help', `\nSee more help with \`${helpCommand}\``);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
80
|
throw error;
|
|
97
81
|
}
|
|
98
82
|
}
|
package/build/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;AAoEA,0CAEC;
|
|
1
|
+
{"version":3,"file":"app.js","sourceRoot":"","sources":["../src/app.ts"],"names":[],"mappings":";;;AAoEA,0CAEC;AAoFD,kBA4BC;AArKD,+CAA+C;AAE/C,2CAIqB;AACrB,iDAAgD;AAChD,uCAAyC;AACzC,sCAAuD;AAM1C,QAAA,WAAW,GAAG,IAAA,gBAAS,EAAC,KAAK,IAAI,EAAE;IAC/C,MAAM,MAAM,GAAG,2CAAa,UAAU,EAAC,CAAC;IACxC,MAAM,MAAM,GAAG,2CAAa,cAAc,EAAC,CAAC;IAC5C,MAAM,CAAC,IAAI,CAAC;QACX,GAAG,EAAE,MAAM,CAAC,SAAS;QACrB,OAAO,EAAE,WAAW,CAAC,OAAO;KAC5B,CAAC,CAAC;IACH,MAAM,CAAC,eAAe,EAAE,CAAC,SAAS,CAAC;QAClC,YAAY,EAAE,OAAO,CAAC,OAAO;QAC7B,QAAQ,EAAE,OAAO,CAAC,QAAQ;KAC1B,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,KAAK,UAAU,gBAAgB;IAC9B,MAAM,iBAAiB,GAAG,WA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OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;AACF,CAAC"}
|
package/build/help.d.ts
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
import type { Command
|
|
1
|
+
import type { Command } from '@oclif/core';
|
|
2
2
|
import { Help } from '@oclif/core';
|
|
3
3
|
import type { ResolvableReturnType } from 'balena-sdk/typings/utils';
|
|
4
4
|
export default class BalenaHelp extends Help {
|
|
5
|
-
private SUPPRESS_SUBTOPICS_DEPTH;
|
|
6
|
-
protected get sortedCommands(): Command.Loadable[];
|
|
7
|
-
protected get sortedTopics(): Interfaces.Topic[];
|
|
8
|
-
showCommandHelp(command: Command.Loadable): Promise<void>;
|
|
9
5
|
showHelp(argv: string[]): Promise<void>;
|
|
10
6
|
getCustomRootHelp(showAllCommands: boolean): string;
|
|
11
7
|
protected formatGlobalOpts(opts: string[][]): string;
|
package/build/help.js
CHANGED
|
@@ -20,7 +20,6 @@ function getHelpSubject(args) {
|
|
|
20
20
|
class BalenaHelp extends core_1.Help {
|
|
21
21
|
constructor() {
|
|
22
22
|
super(...arguments);
|
|
23
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = null;
|
|
24
23
|
this.manuallySortedPrimaryCommands = [
|
|
25
24
|
'login',
|
|
26
25
|
'push',
|
|
@@ -33,29 +32,6 @@ class BalenaHelp extends core_1.Help {
|
|
|
33
32
|
'leave',
|
|
34
33
|
];
|
|
35
34
|
}
|
|
36
|
-
get sortedCommands() {
|
|
37
|
-
const commands = super.sortedCommands;
|
|
38
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
39
|
-
return commands;
|
|
40
|
-
}
|
|
41
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
42
|
-
return commands.filter((c) => c.id.split(':').length <= depth);
|
|
43
|
-
}
|
|
44
|
-
get sortedTopics() {
|
|
45
|
-
const topics = super.sortedTopics;
|
|
46
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
47
|
-
return topics;
|
|
48
|
-
}
|
|
49
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
50
|
-
return topics.filter((t) => t.name.split(':').length <= depth);
|
|
51
|
-
}
|
|
52
|
-
async showCommandHelp(command) {
|
|
53
|
-
const name = command.id;
|
|
54
|
-
const depth = name.split(':').length;
|
|
55
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = depth;
|
|
56
|
-
await super.showCommandHelp(command);
|
|
57
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = null;
|
|
58
|
-
}
|
|
59
35
|
async showHelp(argv) {
|
|
60
36
|
const ux = (0, lazy_1.getCliUx)();
|
|
61
37
|
const subject = getHelpSubject(argv);
|
package/build/help.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;AAiBA,sCAAmC;AACnC,wCAAwC;AAExC,uCAAwC;AAKxC,SAAS,cAAc,CAAC,IAAc;IACrC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO;QACR,CAAC;QACD,IAAI,GAAG,KAAK,MAAM,IAAI,GAAG,KAAK,QAAQ,EAAE,CAAC;YACxC,SAAS;QACV,CAAC;QACD,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO;QACR,CAAC;QACD,OAAO,GAAG,CAAC;IACZ,CAAC;AACF,CAAC;AAED,MAAqB,UAAW,SAAQ,WAAI;IAA5C;;
|
|
1
|
+
{"version":3,"file":"help.js","sourceRoot":"","sources":["../src/help.ts"],"names":[],"mappings":";;AAiBA,sCAAmC;AACnC,wCAAwC;AAExC,uCAAwC;AAKxC,SAAS,cAAc,CAAC,IAAc;IACrC,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACxB,IAAI,GAAG,KAAK,IAAI,E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C;YACzB,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC,WAAW,CAAC;SACrC,CAAC,EACF;YACC,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS;YAC9B,WAAW,EAAE,CAAC;YACd,SAAS,EAAE,KAAK;SAChB,CACD,CAAC;QAEF,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IACxB,CAAC;IAES,iBAAiB,CAAC,IAAI,GAAG,EAAE;QACpC,MAAM,EAAE,GAAG,IAAA,eAAQ,GAAE,CAAC;QACtB,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;QAE3B,IAAI,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC3C,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC;YAC1D,IAAI,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACvD,CAAC;QACD,OAAO,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;CAaD;AAxMD,6BAwMC"}
|
package/build/hooks/prerun.js
CHANGED
|
@@ -26,8 +26,10 @@ const hook = async function (options) {
|
|
|
26
26
|
.authenticated) !== null && _b !== void 0 ? _b : DEFAULT_AUTHENTICATED) {
|
|
27
27
|
await (0, patterns_1.checkLoggedIn)();
|
|
28
28
|
}
|
|
29
|
-
if (
|
|
30
|
-
.
|
|
29
|
+
if (options.Command.id !== 'version' &&
|
|
30
|
+
!/^autocomplete\b/.test(options.Command.id) &&
|
|
31
|
+
!((_c = options.Command
|
|
32
|
+
.offlineCompatible) !== null && _c !== void 0 ? _c : DEFAULT_OFFLINE_COMPATIBLE)) {
|
|
31
33
|
(0, patterns_1.checkNotUsingOfflineMode)();
|
|
32
34
|
}
|
|
33
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prerun.js","sourceRoot":"","sources":["../../src/hooks/prerun.ts"],"names":[],"mappings":";;;AAsBA,sCAAwD;AACxD,gDAA4E;AAE5E,IAAI,YAA4C,CAAC;AAGpC,QAAA,YAAY,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;IACnD,YAAY,GAAG,OAAO,CAAC;AACxB,CAAC,CAAC,CAAC;AAWH,MAAM,uBAAuB,GAAG,KAAK,IAAI,EAAE;IAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,2CAAa,aAAa,EAAC,CAAC,EAAE,CAAC;IACzD,IAAI,CAAC,UAAU,EAAE,CAAC;QACjB,MAAM,IAAI,oCAA2B,CACpC,oDAAoD,CACpD,CAAC;IACH,CAAC;AACF,CAAC,CAAC;AAQF,MAAM,YAAY,GAAG,KAAK,CAAC;AAO3B,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAOpC,MAAM,0BAA0B,GAAG,KAAK,CAAC;AAYzC,MAAM,IAAI,GAAmB,KAAK,WAAW,OAAO;;IACnD,IAAI,CAAC;QACJ,IACC,MAAC,OAAO,CAAC,OAA6C,CAAC,IAAI,mCAC3D,YAAY,EACX,CAAC;YACF,MAAM,uBAAuB,EAAE,CAAC;QACjC,CAAC;QAED,IACC,MAAC,OAAO,CAAC,OAAsD;aAC7D,aAAa,mCACf,qBAAqB,EACpB,CAAC;YACF,MAAM,IAAA,wBAAa,GAAE,CAAC;QACvB,CAAC;QAED,
|
|
1
|
+
{"version":3,"file":"prerun.js","sourceRoot":"","sources":["../../src/hooks/prerun.ts"],"names":[],"mappings":";;;AAsBA,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CAAC;IACzC,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;IAI/B,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,kBAAe,IAAI,CAAC"}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balena-cli",
|
|
3
|
-
"version": "23.1.2-build-
|
|
3
|
+
"version": "23.1.2-build-fix-not-being-able-to-use-version-and-autocomplete-offline-74f7b5d0fe4bbbf39f7aea381b3c09ff80c9bbcd-1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "balena-cli",
|
|
9
|
-
"version": "23.1.2-build-
|
|
9
|
+
"version": "23.1.2-build-fix-not-being-able-to-use-version-and-autocomplete-offline-74f7b5d0fe4bbbf39f7aea381b3c09ff80c9bbcd-1",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"dependencies": {
|
package/oclif.manifest.json
CHANGED
|
@@ -160,6 +160,56 @@
|
|
|
160
160
|
"create.js"
|
|
161
161
|
]
|
|
162
162
|
},
|
|
163
|
+
"block:create": {
|
|
164
|
+
"aliases": [],
|
|
165
|
+
"args": {
|
|
166
|
+
"name": {
|
|
167
|
+
"description": "block name",
|
|
168
|
+
"name": "name",
|
|
169
|
+
"required": true
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
"description": "Create an block.\n\nCreate a new balena block.\n\nYou can specify the organization the block should belong to using\nthe `--organization` option. The organization's handle, not its name,\nshould be provided. Organization handles can be listed with the\n`balena organization list` command.\n\nThe block's default device type is specified with the `--type` option.\nThe `balena device-type list` command can be used to list the available\ndevice types.\n\nInteractive dropdowns will be shown for selection if no device type or\norganization is specified and there are multiple options to choose from.\nIf there is a single option to choose from, it will be chosen automatically.\nThis interactive behavior can be disabled by explicitly specifying a device\ntype and organization.",
|
|
173
|
+
"examples": [
|
|
174
|
+
"$ balena block create MyBlock",
|
|
175
|
+
"$ balena block create MyBlock --organization mmyorg",
|
|
176
|
+
"$ balena block create MyBlock -o myorg --type raspberry-pi"
|
|
177
|
+
],
|
|
178
|
+
"flags": {
|
|
179
|
+
"organization": {
|
|
180
|
+
"char": "o",
|
|
181
|
+
"description": "handle of the organization the block should belong to",
|
|
182
|
+
"name": "organization",
|
|
183
|
+
"hasDynamicHelp": false,
|
|
184
|
+
"multiple": false,
|
|
185
|
+
"type": "option"
|
|
186
|
+
},
|
|
187
|
+
"type": {
|
|
188
|
+
"char": "t",
|
|
189
|
+
"description": "block device type (Check available types with `balena device-type list`)",
|
|
190
|
+
"name": "type",
|
|
191
|
+
"hasDynamicHelp": false,
|
|
192
|
+
"multiple": false,
|
|
193
|
+
"type": "option"
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
"hasDynamicHelp": false,
|
|
197
|
+
"hiddenAliases": [],
|
|
198
|
+
"id": "block:create",
|
|
199
|
+
"pluginAlias": "balena-cli",
|
|
200
|
+
"pluginName": "balena-cli",
|
|
201
|
+
"pluginType": "core",
|
|
202
|
+
"strict": true,
|
|
203
|
+
"enableJsonFlag": false,
|
|
204
|
+
"authenticated": true,
|
|
205
|
+
"isESM": false,
|
|
206
|
+
"relativePath": [
|
|
207
|
+
"build",
|
|
208
|
+
"commands",
|
|
209
|
+
"block",
|
|
210
|
+
"create.js"
|
|
211
|
+
]
|
|
212
|
+
},
|
|
163
213
|
"build": {
|
|
164
214
|
"aliases": [],
|
|
165
215
|
"args": {
|
|
@@ -362,56 +412,6 @@
|
|
|
362
412
|
"index.js"
|
|
363
413
|
]
|
|
364
414
|
},
|
|
365
|
-
"block:create": {
|
|
366
|
-
"aliases": [],
|
|
367
|
-
"args": {
|
|
368
|
-
"name": {
|
|
369
|
-
"description": "block name",
|
|
370
|
-
"name": "name",
|
|
371
|
-
"required": true
|
|
372
|
-
}
|
|
373
|
-
},
|
|
374
|
-
"description": "Create an block.\n\nCreate a new balena block.\n\nYou can specify the organization the block should belong to using\nthe `--organization` option. The organization's handle, not its name,\nshould be provided. Organization handles can be listed with the\n`balena organization list` command.\n\nThe block's default device type is specified with the `--type` option.\nThe `balena device-type list` command can be used to list the available\ndevice types.\n\nInteractive dropdowns will be shown for selection if no device type or\norganization is specified and there are multiple options to choose from.\nIf there is a single option to choose from, it will be chosen automatically.\nThis interactive behavior can be disabled by explicitly specifying a device\ntype and organization.",
|
|
375
|
-
"examples": [
|
|
376
|
-
"$ balena block create MyBlock",
|
|
377
|
-
"$ balena block create MyBlock --organization mmyorg",
|
|
378
|
-
"$ balena block create MyBlock -o myorg --type raspberry-pi"
|
|
379
|
-
],
|
|
380
|
-
"flags": {
|
|
381
|
-
"organization": {
|
|
382
|
-
"char": "o",
|
|
383
|
-
"description": "handle of the organization the block should belong to",
|
|
384
|
-
"name": "organization",
|
|
385
|
-
"hasDynamicHelp": false,
|
|
386
|
-
"multiple": false,
|
|
387
|
-
"type": "option"
|
|
388
|
-
},
|
|
389
|
-
"type": {
|
|
390
|
-
"char": "t",
|
|
391
|
-
"description": "block device type (Check available types with `balena device-type list`)",
|
|
392
|
-
"name": "type",
|
|
393
|
-
"hasDynamicHelp": false,
|
|
394
|
-
"multiple": false,
|
|
395
|
-
"type": "option"
|
|
396
|
-
}
|
|
397
|
-
},
|
|
398
|
-
"hasDynamicHelp": false,
|
|
399
|
-
"hiddenAliases": [],
|
|
400
|
-
"id": "block:create",
|
|
401
|
-
"pluginAlias": "balena-cli",
|
|
402
|
-
"pluginName": "balena-cli",
|
|
403
|
-
"pluginType": "core",
|
|
404
|
-
"strict": true,
|
|
405
|
-
"enableJsonFlag": false,
|
|
406
|
-
"authenticated": true,
|
|
407
|
-
"isESM": false,
|
|
408
|
-
"relativePath": [
|
|
409
|
-
"build",
|
|
410
|
-
"commands",
|
|
411
|
-
"block",
|
|
412
|
-
"create.js"
|
|
413
|
-
]
|
|
414
|
-
},
|
|
415
415
|
"config:generate": {
|
|
416
416
|
"aliases": [],
|
|
417
417
|
"args": {},
|
|
@@ -4509,28 +4509,6 @@
|
|
|
4509
4509
|
"rm.js"
|
|
4510
4510
|
]
|
|
4511
4511
|
},
|
|
4512
|
-
"util:available-drives": {
|
|
4513
|
-
"aliases": [],
|
|
4514
|
-
"args": {},
|
|
4515
|
-
"description": "List available drives.\n\nList available drives which are usable for writing an OS image to.\nDoes not list system drives.",
|
|
4516
|
-
"flags": {},
|
|
4517
|
-
"hasDynamicHelp": false,
|
|
4518
|
-
"hiddenAliases": [],
|
|
4519
|
-
"id": "util:available-drives",
|
|
4520
|
-
"pluginAlias": "balena-cli",
|
|
4521
|
-
"pluginName": "balena-cli",
|
|
4522
|
-
"pluginType": "core",
|
|
4523
|
-
"strict": true,
|
|
4524
|
-
"enableJsonFlag": false,
|
|
4525
|
-
"offlineCompatible": true,
|
|
4526
|
-
"isESM": false,
|
|
4527
|
-
"relativePath": [
|
|
4528
|
-
"build",
|
|
4529
|
-
"commands",
|
|
4530
|
-
"util",
|
|
4531
|
-
"available-drives.js"
|
|
4532
|
-
]
|
|
4533
|
-
},
|
|
4534
4512
|
"tag:list": {
|
|
4535
4513
|
"aliases": [],
|
|
4536
4514
|
"args": {},
|
|
@@ -4751,6 +4729,28 @@
|
|
|
4751
4729
|
"set.js"
|
|
4752
4730
|
]
|
|
4753
4731
|
},
|
|
4732
|
+
"util:available-drives": {
|
|
4733
|
+
"aliases": [],
|
|
4734
|
+
"args": {},
|
|
4735
|
+
"description": "List available drives.\n\nList available drives which are usable for writing an OS image to.\nDoes not list system drives.",
|
|
4736
|
+
"flags": {},
|
|
4737
|
+
"hasDynamicHelp": false,
|
|
4738
|
+
"hiddenAliases": [],
|
|
4739
|
+
"id": "util:available-drives",
|
|
4740
|
+
"pluginAlias": "balena-cli",
|
|
4741
|
+
"pluginName": "balena-cli",
|
|
4742
|
+
"pluginType": "core",
|
|
4743
|
+
"strict": true,
|
|
4744
|
+
"enableJsonFlag": false,
|
|
4745
|
+
"offlineCompatible": true,
|
|
4746
|
+
"isESM": false,
|
|
4747
|
+
"relativePath": [
|
|
4748
|
+
"build",
|
|
4749
|
+
"commands",
|
|
4750
|
+
"util",
|
|
4751
|
+
"available-drives.js"
|
|
4752
|
+
]
|
|
4753
|
+
},
|
|
4754
4754
|
"whoami": {
|
|
4755
4755
|
"aliases": [],
|
|
4756
4756
|
"args": {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "balena-cli",
|
|
3
|
-
"version": "23.1.2-build-
|
|
3
|
+
"version": "23.1.2-build-fix-not-being-able-to-use-version-and-autocomplete-offline-74f7b5d0fe4bbbf39f7aea381b3c09ff80c9bbcd-1",
|
|
4
4
|
"description": "The official balena Command Line Interface",
|
|
5
5
|
"main": "./build/app.js",
|
|
6
6
|
"homepage": "https://github.com/balena-io/balena-cli",
|
|
@@ -262,6 +262,6 @@
|
|
|
262
262
|
"balena-request": "14.0.6"
|
|
263
263
|
},
|
|
264
264
|
"versionist": {
|
|
265
|
-
"publishedAt": "2025-11-
|
|
265
|
+
"publishedAt": "2025-11-18T22:00:14.810Z"
|
|
266
266
|
}
|
|
267
267
|
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
diff --git a/node_modules/@oclif/core/lib/help/index.js b/node_modules/@oclif/core/lib/help/index.js
|
|
2
|
+
index 5846c71..d47d146 100644
|
|
3
|
+
--- a/node_modules/@oclif/core/lib/help/index.js
|
|
4
|
+
+++ b/node_modules/@oclif/core/lib/help/index.js
|
|
5
|
+
@@ -186,11 +186,12 @@ class Help extends HelpBase {
|
|
6
|
+
}
|
|
7
|
+
this.log(this.formatCommand(command));
|
|
8
|
+
this.log('');
|
|
9
|
+
- if (subTopics.length > 0) {
|
|
10
|
+
+ const SUPPRESS_SUBTOPICS = true;
|
|
11
|
+
+ if (subTopics.length > 0 && !SUPPRESS_SUBTOPICS) {
|
|
12
|
+
this.log(this.formatTopics(subTopics));
|
|
13
|
+
this.log('');
|
|
14
|
+
}
|
|
15
|
+
- if (subCommands.length > 0) {
|
|
16
|
+
+ if (subCommands.length > 0 && !SUPPRESS_SUBTOPICS) {
|
|
17
|
+
const aliases = [];
|
|
18
|
+
const uniqueSubCommands = subCommands.filter((p) => {
|
|
19
|
+
aliases.push(...p.aliases);
|
|
20
|
+
diff --git a/node_modules/@oclif/core/lib/parser/errors.js b/node_modules/@oclif/core/lib/parser/errors.js
|
|
21
|
+
index 168da99..538a880 100644
|
|
22
|
+
--- a/node_modules/@oclif/core/lib/parser/errors.js
|
|
23
|
+
+++ b/node_modules/@oclif/core/lib/parser/errors.js
|
|
24
|
+
@@ -15,7 +15,8 @@ class CLIParseError extends errors_1.CLIError {
|
|
25
|
+
parse;
|
|
26
|
+
showHelp = false;
|
|
27
|
+
constructor(options) {
|
|
28
|
+
- options.message += '\nSee more help with --help';
|
|
29
|
+
+ const help = options.command ? `\`${options.command} --help\`` : '--help';
|
|
30
|
+
+ options.message += `\nSee more help with ${help}`;
|
|
31
|
+
super(options.message, { exit: options.exit });
|
|
32
|
+
this.parse = options.parse;
|
|
33
|
+
}
|
|
34
|
+
@@ -38,7 +39,8 @@ exports.InvalidArgsSpecError = InvalidArgsSpecError;
|
|
35
|
+
class RequiredArgsError extends CLIParseError {
|
|
36
|
+
args;
|
|
37
|
+
constructor({ args, exit, flagsWithMultiple, parse, }) {
|
|
38
|
+
- let message = `Missing ${args.length} required arg${args.length === 1 ? '' : 's'}`;
|
|
39
|
+
+ const command = 'balena ' + parse.input.context.id.replace(/:/g, ' ');
|
|
40
|
+
+ let message = `Missing ${args.length} required argument${args.length === 1 ? '' : 's'}`;
|
|
41
|
+
const namedArgs = args.filter((a) => a.name);
|
|
42
|
+
if (namedArgs.length > 0) {
|
|
43
|
+
const list = (0, list_1.default)(namedArgs.map((a) => {
|
|
44
|
+
@@ -52,7 +54,7 @@ class RequiredArgsError extends CLIParseError {
|
|
45
|
+
message += `\n\nNote: ${flags} allow${flagsWithMultiple.length === 1 ? 's' : ''} multiple values. Because of this you need to provide all arguments before providing ${flagsWithMultiple.length === 1 ? 'that flag' : 'those flags'}.`;
|
|
46
|
+
message += '\nAlternatively, you can use "--" to signify the end of the flags and the beginning of arguments.';
|
|
47
|
+
}
|
|
48
|
+
- super({ exit: cache_1.default.getInstance().get('exitCodes')?.requiredArgs ?? exit, message, parse });
|
|
49
|
+
+ super({ exit: cache_1.default.getInstance().get('exitCodes')?.requiredArgs ?? exit, message, parse, command });
|
|
50
|
+
this.args = args;
|
|
51
|
+
this.showHelp = true;
|
|
52
|
+
}
|
|
53
|
+
diff --git a/node_modules/@oclif/core/lib/ux/list.js b/node_modules/@oclif/core/lib/ux/list.js
|
|
54
|
+
index ebafa29..55c88e5 100644
|
|
55
|
+
--- a/node_modules/@oclif/core/lib/ux/list.js
|
|
56
|
+
+++ b/node_modules/@oclif/core/lib/ux/list.js
|
|
57
|
+
@@ -22,7 +22,7 @@ function renderList(items) {
|
|
58
|
+
}
|
|
59
|
+
left = left.padEnd(maxLength);
|
|
60
|
+
right = linewrap(maxLength + 2, right);
|
|
61
|
+
- return `${left} ${right}`;
|
|
62
|
+
+ return `${left} : ${right}`;
|
|
63
|
+
});
|
|
64
|
+
return lines.join('\n');
|
|
65
|
+
}
|
package/src/app.ts
CHANGED
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from './preparser';
|
|
25
25
|
import { CliSettings } from './utils/bootstrap';
|
|
26
26
|
import { onceAsync } from './utils/lazy';
|
|
27
|
-
import { run as mainRun, settings
|
|
27
|
+
import { run as mainRun, settings } from '@oclif/core';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Sentry.io setup
|
|
@@ -126,34 +126,6 @@ async function oclifRun(command: string[], options: AppOptions) {
|
|
|
126
126
|
if (error.oclif?.exit === 0) {
|
|
127
127
|
isEEXIT = true;
|
|
128
128
|
} else {
|
|
129
|
-
if (error instanceof Errors.CLIError) {
|
|
130
|
-
const RequiredArgsErrorRegex = /^Missing (\d+) required arg(s?\b)/;
|
|
131
|
-
if (RequiredArgsErrorRegex.exec(error.message) != null) {
|
|
132
|
-
error.message = error.message
|
|
133
|
-
.split('\n')
|
|
134
|
-
.map((line, i) => {
|
|
135
|
-
if (i === 0) {
|
|
136
|
-
// Replace 'arg(s)' with 'argument(s)'
|
|
137
|
-
return line.replace(
|
|
138
|
-
RequiredArgsErrorRegex,
|
|
139
|
-
'Missing $1 required argument$2',
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
// Add a ':' between the missing argument name and its description
|
|
143
|
-
return line.replace(
|
|
144
|
-
/^(?<argName>[\w-]+)(?<paddingSpaces>[ ]+)[ ](?<description>\w)/,
|
|
145
|
-
'$<argName>$<paddingSpaces>: $<description>',
|
|
146
|
-
);
|
|
147
|
-
})
|
|
148
|
-
.join('\n');
|
|
149
|
-
// Print the whole command used along with '--help'
|
|
150
|
-
const helpCommand = `balena ${command.map((c, i) => (i === 0 ? c.replace(/:/g, ' ') : c)).join(' ')} --help`;
|
|
151
|
-
error.message = error.message.replace(
|
|
152
|
-
'\nSee more help with --help',
|
|
153
|
-
`\nSee more help with \`${helpCommand}\``,
|
|
154
|
-
);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
129
|
throw error;
|
|
158
130
|
}
|
|
159
131
|
}
|
package/src/help.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import type { Command
|
|
17
|
+
import type { Command } from '@oclif/core';
|
|
18
18
|
import { Help } from '@oclif/core';
|
|
19
19
|
import * as indent from 'indent-string';
|
|
20
20
|
import type { ResolvableReturnType } from 'balena-sdk/typings/utils';
|
|
@@ -39,36 +39,6 @@ function getHelpSubject(args: string[]): string | undefined {
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export default class BalenaHelp extends Help {
|
|
42
|
-
private SUPPRESS_SUBTOPICS_DEPTH: number | null = null;
|
|
43
|
-
|
|
44
|
-
protected get sortedCommands(): Command.Loadable[] {
|
|
45
|
-
const commands = super.sortedCommands;
|
|
46
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
47
|
-
return commands;
|
|
48
|
-
}
|
|
49
|
-
// Assign it to a const so that TS knows that this can't change to null during the .filter
|
|
50
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
51
|
-
return commands.filter((c) => c.id.split(':').length <= depth);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
protected get sortedTopics(): Interfaces.Topic[] {
|
|
55
|
-
const topics = super.sortedTopics;
|
|
56
|
-
if (this.SUPPRESS_SUBTOPICS_DEPTH == null) {
|
|
57
|
-
return topics;
|
|
58
|
-
}
|
|
59
|
-
// Assign it to a const so that TS knows that this can't change to null during the .filter
|
|
60
|
-
const depth = this.SUPPRESS_SUBTOPICS_DEPTH;
|
|
61
|
-
return topics.filter((t) => t.name.split(':').length <= depth);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
public async showCommandHelp(command: Command.Loadable): Promise<void> {
|
|
65
|
-
const name = command.id;
|
|
66
|
-
const depth = name.split(':').length;
|
|
67
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = depth;
|
|
68
|
-
await super.showCommandHelp(command);
|
|
69
|
-
this.SUPPRESS_SUBTOPICS_DEPTH = null;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
42
|
public async showHelp(argv: string[]) {
|
|
73
43
|
const ux = getCliUx();
|
|
74
44
|
const subject = getHelpSubject(argv);
|
package/src/hooks/prerun.ts
CHANGED
|
@@ -98,6 +98,9 @@ const hook: Hook<'prerun'> = async function (options) {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
if (
|
|
101
|
+
// version and autocomplete come from oclif plugins, for which we cannot add offlineCompatible true
|
|
102
|
+
options.Command.id !== 'version' &&
|
|
103
|
+
!/^autocomplete\b/.test(options.Command.id) &&
|
|
101
104
|
!(
|
|
102
105
|
(options.Command as Command.Class & { offlineCompatible: boolean })
|
|
103
106
|
.offlineCompatible ?? DEFAULT_OFFLINE_COMPATIBLE
|