@betty-blocks/cli 25.109.0-beta.1 → 26.0.0-alpha.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.
Files changed (46) hide show
  1. package/assets/app-functions/wasm-template/.wasm-functions +0 -0
  2. package/assets/app-functions/wasm-template/functions/say-hello/1.0/Cargo.lock +449 -0
  3. package/assets/app-functions/wasm-template/functions/say-hello/1.0/Cargo.toml +10 -0
  4. package/assets/app-functions/wasm-template/functions/say-hello/1.0/Justfile +6 -0
  5. package/assets/app-functions/wasm-template/functions/say-hello/1.0/function.json +35 -0
  6. package/assets/app-functions/wasm-template/functions/say-hello/1.0/src/lib.rs +19 -0
  7. package/assets/app-functions/wasm-template/functions/say-hello/1.0/wit/world.wit +13 -0
  8. package/build/src/bb-blocks-new.js +5361 -2181
  9. package/build/src/bb-blocks-publish.js +11493 -18303
  10. package/build/src/bb-blocks-release.js +65 -46
  11. package/build/src/bb-blocks.js +32 -32
  12. package/build/src/bb-bundle-init.js +1542 -912
  13. package/build/src/bb-bundle.js +35 -32
  14. package/build/src/bb-components-build.js +34965 -7598
  15. package/build/src/bb-components-create.js +1542 -912
  16. package/build/src/bb-components-generate.js +1542 -912
  17. package/build/src/bb-components-publish-bundle.js +1519 -889
  18. package/build/src/bb-components-publish.js +1522 -892
  19. package/build/src/bb-components-serve.js +1524 -894
  20. package/build/src/bb-components.js +32 -32
  21. package/build/src/bb-functions-bump.js +6047 -2733
  22. package/build/src/bb-functions-init.js +100 -593
  23. package/build/src/bb-functions-login.js +65 -46
  24. package/build/src/bb-functions-logout.js +65 -46
  25. package/build/src/bb-functions-new.js +5464 -2195
  26. package/build/src/bb-functions-publish.js +15134 -76022
  27. package/build/src/bb-functions-validate.js +7262 -3950
  28. package/build/src/bb-functions.js +35 -37
  29. package/build/src/bb.js +76 -74
  30. package/package.json +41 -42
  31. package/assets/app-functions/templates/test/helpers.js +0 -3
  32. package/assets/app-functions/templates/test/say-hello.test.js +0 -4
  33. package/assets/functions/packer/package.json +0 -9
  34. package/assets/functions/packer/webpack.config.js +0 -12
  35. package/assets/functions/templates/functions.json +0 -14
  36. package/assets/functions/templates/package.json +0 -11
  37. package/assets/functions/templates/src/all-users.js +0 -14
  38. package/assets/functions/templates/src/get-json.js +0 -9
  39. package/assets/functions/templates/src/index.js +0 -5
  40. package/assets/functions/templates/src/say-hello.js +0 -13
  41. package/build/src/bb-functions-build.js +0 -4285
  42. package/src/bb.ts +0 -31
  43. /package/assets/app-functions/{templates → js-template}/.app-functions +0 -0
  44. /package/assets/app-functions/{templates → js-template}/functions/say-hello/1.0/function.json +0 -0
  45. /package/assets/app-functions/{templates → js-template}/functions/say-hello/1.0/index.js +0 -0
  46. /package/assets/app-functions/{templates → js-template}/package.json +0 -0
@@ -78,7 +78,7 @@ var require_argument = __commonJS((exports) => {
78
78
  this._name = name;
79
79
  break;
80
80
  }
81
- if (this._name.length > 3 && this._name.slice(-3) === "...") {
81
+ if (this._name.endsWith("...")) {
82
82
  this.variadic = true;
83
83
  this._name = this._name.slice(0, -3);
84
84
  }
@@ -86,11 +86,12 @@ var require_argument = __commonJS((exports) => {
86
86
  name() {
87
87
  return this._name;
88
88
  }
89
- _concatValue(value, previous) {
89
+ _collectValue(value, previous) {
90
90
  if (previous === this.defaultValue || !Array.isArray(previous)) {
91
91
  return [value];
92
92
  }
93
- return previous.concat(value);
93
+ previous.push(value);
94
+ return previous;
94
95
  }
95
96
  default(value, description) {
96
97
  this.defaultValue = value;
@@ -108,7 +109,7 @@ var require_argument = __commonJS((exports) => {
108
109
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
109
110
  }
110
111
  if (this.variadic) {
111
- return this._concatValue(arg, previous);
112
+ return this._collectValue(arg, previous);
112
113
  }
113
114
  return arg;
114
115
  };
@@ -555,11 +556,12 @@ var require_option = __commonJS((exports) => {
555
556
  this.hidden = !!hide;
556
557
  return this;
557
558
  }
558
- _concatValue(value, previous) {
559
+ _collectValue(value, previous) {
559
560
  if (previous === this.defaultValue || !Array.isArray(previous)) {
560
561
  return [value];
561
562
  }
562
- return previous.concat(value);
563
+ previous.push(value);
564
+ return previous;
563
565
  }
564
566
  choices(values) {
565
567
  this.argChoices = values.slice();
@@ -568,7 +570,7 @@ var require_option = __commonJS((exports) => {
568
570
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
569
571
  }
570
572
  if (this.variadic) {
571
- return this._concatValue(arg, previous);
573
+ return this._collectValue(arg, previous);
572
574
  }
573
575
  return arg;
574
576
  };
@@ -874,7 +876,10 @@ var require_command = __commonJS((exports) => {
874
876
  configureOutput(configuration) {
875
877
  if (configuration === undefined)
876
878
  return this._outputConfiguration;
877
- this._outputConfiguration = Object.assign({}, this._outputConfiguration, configuration);
879
+ this._outputConfiguration = {
880
+ ...this._outputConfiguration,
881
+ ...configuration
882
+ };
878
883
  return this;
879
884
  }
880
885
  showHelpAfterError(displayHelp = true) {
@@ -923,7 +928,7 @@ var require_command = __commonJS((exports) => {
923
928
  }
924
929
  addArgument(argument) {
925
930
  const previousArgument = this.registeredArguments.slice(-1)[0];
926
- if (previousArgument && previousArgument.variadic) {
931
+ if (previousArgument?.variadic) {
927
932
  throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
928
933
  }
929
934
  if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
@@ -1078,7 +1083,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1078
1083
  if (val !== null && option.parseArg) {
1079
1084
  val = this._callParseArg(option, val, oldValue, invalidValueMessage);
1080
1085
  } else if (val !== null && option.variadic) {
1081
- val = option._concatValue(val, oldValue);
1086
+ val = option._collectValue(val, oldValue);
1082
1087
  }
1083
1088
  if (val == null) {
1084
1089
  if (option.negate) {
@@ -1453,7 +1458,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1453
1458
  this.processedArgs = processedArgs;
1454
1459
  }
1455
1460
  _chainOrCall(promise, fn) {
1456
- if (promise && promise.then && typeof promise.then === "function") {
1461
+ if (promise?.then && typeof promise.then === "function") {
1457
1462
  return promise.then(() => fn());
1458
1463
  }
1459
1464
  return fn();
@@ -1530,7 +1535,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1530
1535
  promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
1531
1536
  return promiseChain;
1532
1537
  }
1533
- if (this.parent && this.parent.listenerCount(commandEvent)) {
1538
+ if (this.parent?.listenerCount(commandEvent)) {
1534
1539
  checkForUnknownOptions();
1535
1540
  this._processArguments();
1536
1541
  this.parent.emit(commandEvent, operands, unknown);
@@ -1592,11 +1597,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1592
1597
  cmd._checkForConflictingLocalOptions();
1593
1598
  });
1594
1599
  }
1595
- parseOptions(argv) {
1600
+ parseOptions(args) {
1596
1601
  const operands = [];
1597
1602
  const unknown = [];
1598
1603
  let dest = operands;
1599
- const args = argv.slice();
1600
1604
  function maybeOption(arg) {
1601
1605
  return arg.length > 1 && arg[0] === "-";
1602
1606
  }
@@ -1606,12 +1610,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1606
1610
  return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
1607
1611
  };
1608
1612
  let activeVariadicOption = null;
1609
- while (args.length) {
1610
- const arg = args.shift();
1613
+ let activeGroup = null;
1614
+ let i = 0;
1615
+ while (i < args.length || activeGroup) {
1616
+ const arg = activeGroup ?? args[i++];
1617
+ activeGroup = null;
1611
1618
  if (arg === "--") {
1612
1619
  if (dest === unknown)
1613
1620
  dest.push(arg);
1614
- dest.push(...args);
1621
+ dest.push(...args.slice(i));
1615
1622
  break;
1616
1623
  }
1617
1624
  if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
@@ -1623,14 +1630,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1623
1630
  const option = this._findOption(arg);
1624
1631
  if (option) {
1625
1632
  if (option.required) {
1626
- const value = args.shift();
1633
+ const value = args[i++];
1627
1634
  if (value === undefined)
1628
1635
  this.optionMissingArgument(option);
1629
1636
  this.emit(`option:${option.name()}`, value);
1630
1637
  } else if (option.optional) {
1631
1638
  let value = null;
1632
- if (args.length > 0 && (!maybeOption(args[0]) || negativeNumberArg(args[0]))) {
1633
- value = args.shift();
1639
+ if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
1640
+ value = args[i++];
1634
1641
  }
1635
1642
  this.emit(`option:${option.name()}`, value);
1636
1643
  } else {
@@ -1647,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1647
1654
  this.emit(`option:${option.name()}`, arg.slice(2));
1648
1655
  } else {
1649
1656
  this.emit(`option:${option.name()}`);
1650
- args.unshift(`-${arg.slice(2)}`);
1657
+ activeGroup = `-${arg.slice(2)}`;
1651
1658
  }
1652
1659
  continue;
1653
1660
  }
@@ -1666,25 +1673,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
1666
1673
  if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
1667
1674
  if (this._findCommand(arg)) {
1668
1675
  operands.push(arg);
1669
- if (args.length > 0)
1670
- unknown.push(...args);
1676
+ unknown.push(...args.slice(i));
1671
1677
  break;
1672
1678
  } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
1673
- operands.push(arg);
1674
- if (args.length > 0)
1675
- operands.push(...args);
1679
+ operands.push(arg, ...args.slice(i));
1676
1680
  break;
1677
1681
  } else if (this._defaultCommandName) {
1678
- unknown.push(arg);
1679
- if (args.length > 0)
1680
- unknown.push(...args);
1682
+ unknown.push(arg, ...args.slice(i));
1681
1683
  break;
1682
1684
  }
1683
1685
  }
1684
1686
  if (this._passThroughOptions) {
1685
- dest.push(arg);
1686
- if (args.length > 0)
1687
- dest.push(...args);
1687
+ dest.push(arg, ...args.slice(i));
1688
1688
  break;
1689
1689
  }
1690
1690
  dest.push(arg);
@@ -6538,7 +6538,13 @@ var require_node_domexception = __commonJS((exports, module) => {
6538
6538
 
6539
6539
  // node_modules/fetch-blob/from.js
6540
6540
  import { statSync, createReadStream, promises as fs } from "node:fs";
6541
- var import_node_domexception, stat, BlobDataItem;
6541
+ import { basename } from "node:path";
6542
+ var import_node_domexception, stat, fileFromSync = (path, type) => fromFile(statSync(path), path, type), fromFile = (stat2, path, type = "") => new file_default([new BlobDataItem({
6543
+ path,
6544
+ size: stat2.size,
6545
+ lastModified: stat2.mtimeMs,
6546
+ start: 0
6547
+ })], basename(path), { type, lastModified: stat2.mtimeMs }), BlobDataItem;
6542
6548
  var init_from = __esm(() => {
6543
6549
  import_node_domexception = __toESM(require_node_domexception(), 1);
6544
6550
  init_file();
@@ -8068,6 +8074,23 @@ var require_stat = __commonJS((exports, module) => {
8068
8074
  };
8069
8075
  });
8070
8076
 
8077
+ // node_modules/fs-extra/lib/util/async.js
8078
+ var require_async = __commonJS((exports, module) => {
8079
+ async function asyncIteratorConcurrentProcess(iterator, fn) {
8080
+ const promises = [];
8081
+ for await (const item of iterator) {
8082
+ promises.push(fn(item).then(() => null, (err) => err ?? new Error("unknown error")));
8083
+ }
8084
+ await Promise.all(promises.map((promise) => promise.then((possibleErr) => {
8085
+ if (possibleErr !== null)
8086
+ throw possibleErr;
8087
+ })));
8088
+ }
8089
+ module.exports = {
8090
+ asyncIteratorConcurrentProcess
8091
+ };
8092
+ });
8093
+
8071
8094
  // node_modules/fs-extra/lib/copy/copy.js
8072
8095
  var require_copy = __commonJS((exports, module) => {
8073
8096
  var fs2 = require_fs();
@@ -8076,6 +8099,7 @@ var require_copy = __commonJS((exports, module) => {
8076
8099
  var { pathExists } = require_path_exists();
8077
8100
  var { utimesMillis } = require_utimes();
8078
8101
  var stat2 = require_stat();
8102
+ var { asyncIteratorConcurrentProcess } = require_async();
8079
8103
  async function copy(src, dest, opts = {}) {
8080
8104
  if (typeof opts === "function") {
8081
8105
  opts = { filter: opts };
@@ -8151,19 +8175,15 @@ var require_copy = __commonJS((exports, module) => {
8151
8175
  if (!destStat) {
8152
8176
  await fs2.mkdir(dest);
8153
8177
  }
8154
- const promises = [];
8155
- for await (const item of await fs2.opendir(src)) {
8178
+ await asyncIteratorConcurrentProcess(await fs2.opendir(src), async (item) => {
8156
8179
  const srcItem = path.join(src, item.name);
8157
8180
  const destItem = path.join(dest, item.name);
8158
- promises.push(runFilter(srcItem, destItem, opts).then((include) => {
8159
- if (include) {
8160
- return stat2.checkPaths(srcItem, destItem, "copy", opts).then(({ destStat: destStat2 }) => {
8161
- return getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
8162
- });
8163
- }
8164
- }));
8165
- }
8166
- await Promise.all(promises);
8181
+ const include = await runFilter(srcItem, destItem, opts);
8182
+ if (include) {
8183
+ const { destStat: destStat2 } = await stat2.checkPaths(srcItem, destItem, "copy", opts);
8184
+ await getStatsAndPerformCopy(destStat2, srcItem, destItem, opts);
8185
+ }
8186
+ });
8167
8187
  if (!destStat) {
8168
8188
  await fs2.chmod(dest, srcStat.mode);
8169
8189
  }
@@ -8779,13 +8799,12 @@ var require_jsonfile = __commonJS((exports, module) => {
8779
8799
  const str = stringify(obj, options);
8780
8800
  return fs2.writeFileSync(file, str, options);
8781
8801
  }
8782
- var jsonfile = {
8802
+ module.exports = {
8783
8803
  readFile,
8784
8804
  readFileSync,
8785
8805
  writeFile,
8786
8806
  writeFileSync
8787
8807
  };
8788
- module.exports = jsonfile;
8789
8808
  });
8790
8809
 
8791
8810
  // node_modules/fs-extra/lib/json/jsonfile.js
@@ -78,7 +78,7 @@ var require_argument = __commonJS((exports) => {
78
78
  this._name = name;
79
79
  break;
80
80
  }
81
- if (this._name.length > 3 && this._name.slice(-3) === "...") {
81
+ if (this._name.endsWith("...")) {
82
82
  this.variadic = true;
83
83
  this._name = this._name.slice(0, -3);
84
84
  }
@@ -86,11 +86,12 @@ var require_argument = __commonJS((exports) => {
86
86
  name() {
87
87
  return this._name;
88
88
  }
89
- _concatValue(value, previous) {
89
+ _collectValue(value, previous) {
90
90
  if (previous === this.defaultValue || !Array.isArray(previous)) {
91
91
  return [value];
92
92
  }
93
- return previous.concat(value);
93
+ previous.push(value);
94
+ return previous;
94
95
  }
95
96
  default(value, description) {
96
97
  this.defaultValue = value;
@@ -108,7 +109,7 @@ var require_argument = __commonJS((exports) => {
108
109
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
109
110
  }
110
111
  if (this.variadic) {
111
- return this._concatValue(arg, previous);
112
+ return this._collectValue(arg, previous);
112
113
  }
113
114
  return arg;
114
115
  };
@@ -555,11 +556,12 @@ var require_option = __commonJS((exports) => {
555
556
  this.hidden = !!hide;
556
557
  return this;
557
558
  }
558
- _concatValue(value, previous) {
559
+ _collectValue(value, previous) {
559
560
  if (previous === this.defaultValue || !Array.isArray(previous)) {
560
561
  return [value];
561
562
  }
562
- return previous.concat(value);
563
+ previous.push(value);
564
+ return previous;
563
565
  }
564
566
  choices(values) {
565
567
  this.argChoices = values.slice();
@@ -568,7 +570,7 @@ var require_option = __commonJS((exports) => {
568
570
  throw new InvalidArgumentError(`Allowed choices are ${this.argChoices.join(", ")}.`);
569
571
  }
570
572
  if (this.variadic) {
571
- return this._concatValue(arg, previous);
573
+ return this._collectValue(arg, previous);
572
574
  }
573
575
  return arg;
574
576
  };
@@ -874,7 +876,10 @@ var require_command = __commonJS((exports) => {
874
876
  configureOutput(configuration) {
875
877
  if (configuration === undefined)
876
878
  return this._outputConfiguration;
877
- this._outputConfiguration = Object.assign({}, this._outputConfiguration, configuration);
879
+ this._outputConfiguration = {
880
+ ...this._outputConfiguration,
881
+ ...configuration
882
+ };
878
883
  return this;
879
884
  }
880
885
  showHelpAfterError(displayHelp = true) {
@@ -923,7 +928,7 @@ var require_command = __commonJS((exports) => {
923
928
  }
924
929
  addArgument(argument) {
925
930
  const previousArgument = this.registeredArguments.slice(-1)[0];
926
- if (previousArgument && previousArgument.variadic) {
931
+ if (previousArgument?.variadic) {
927
932
  throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
928
933
  }
929
934
  if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
@@ -1078,7 +1083,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1078
1083
  if (val !== null && option.parseArg) {
1079
1084
  val = this._callParseArg(option, val, oldValue, invalidValueMessage);
1080
1085
  } else if (val !== null && option.variadic) {
1081
- val = option._concatValue(val, oldValue);
1086
+ val = option._collectValue(val, oldValue);
1082
1087
  }
1083
1088
  if (val == null) {
1084
1089
  if (option.negate) {
@@ -1453,7 +1458,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1453
1458
  this.processedArgs = processedArgs;
1454
1459
  }
1455
1460
  _chainOrCall(promise, fn) {
1456
- if (promise && promise.then && typeof promise.then === "function") {
1461
+ if (promise?.then && typeof promise.then === "function") {
1457
1462
  return promise.then(() => fn());
1458
1463
  }
1459
1464
  return fn();
@@ -1530,7 +1535,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1530
1535
  promiseChain = this._chainOrCallHooks(promiseChain, "postAction");
1531
1536
  return promiseChain;
1532
1537
  }
1533
- if (this.parent && this.parent.listenerCount(commandEvent)) {
1538
+ if (this.parent?.listenerCount(commandEvent)) {
1534
1539
  checkForUnknownOptions();
1535
1540
  this._processArguments();
1536
1541
  this.parent.emit(commandEvent, operands, unknown);
@@ -1592,11 +1597,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
1592
1597
  cmd._checkForConflictingLocalOptions();
1593
1598
  });
1594
1599
  }
1595
- parseOptions(argv) {
1600
+ parseOptions(args) {
1596
1601
  const operands = [];
1597
1602
  const unknown = [];
1598
1603
  let dest = operands;
1599
- const args = argv.slice();
1600
1604
  function maybeOption(arg) {
1601
1605
  return arg.length > 1 && arg[0] === "-";
1602
1606
  }
@@ -1606,12 +1610,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
1606
1610
  return !this._getCommandAndAncestors().some((cmd) => cmd.options.map((opt) => opt.short).some((short) => /^-\d$/.test(short)));
1607
1611
  };
1608
1612
  let activeVariadicOption = null;
1609
- while (args.length) {
1610
- const arg = args.shift();
1613
+ let activeGroup = null;
1614
+ let i = 0;
1615
+ while (i < args.length || activeGroup) {
1616
+ const arg = activeGroup ?? args[i++];
1617
+ activeGroup = null;
1611
1618
  if (arg === "--") {
1612
1619
  if (dest === unknown)
1613
1620
  dest.push(arg);
1614
- dest.push(...args);
1621
+ dest.push(...args.slice(i));
1615
1622
  break;
1616
1623
  }
1617
1624
  if (activeVariadicOption && (!maybeOption(arg) || negativeNumberArg(arg))) {
@@ -1623,14 +1630,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
1623
1630
  const option = this._findOption(arg);
1624
1631
  if (option) {
1625
1632
  if (option.required) {
1626
- const value = args.shift();
1633
+ const value = args[i++];
1627
1634
  if (value === undefined)
1628
1635
  this.optionMissingArgument(option);
1629
1636
  this.emit(`option:${option.name()}`, value);
1630
1637
  } else if (option.optional) {
1631
1638
  let value = null;
1632
- if (args.length > 0 && (!maybeOption(args[0]) || negativeNumberArg(args[0]))) {
1633
- value = args.shift();
1639
+ if (i < args.length && (!maybeOption(args[i]) || negativeNumberArg(args[i]))) {
1640
+ value = args[i++];
1634
1641
  }
1635
1642
  this.emit(`option:${option.name()}`, value);
1636
1643
  } else {
@@ -1647,7 +1654,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
1647
1654
  this.emit(`option:${option.name()}`, arg.slice(2));
1648
1655
  } else {
1649
1656
  this.emit(`option:${option.name()}`);
1650
- args.unshift(`-${arg.slice(2)}`);
1657
+ activeGroup = `-${arg.slice(2)}`;
1651
1658
  }
1652
1659
  continue;
1653
1660
  }
@@ -1666,25 +1673,18 @@ Expecting one of '${allowedValues.join("', '")}'`);
1666
1673
  if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
1667
1674
  if (this._findCommand(arg)) {
1668
1675
  operands.push(arg);
1669
- if (args.length > 0)
1670
- unknown.push(...args);
1676
+ unknown.push(...args.slice(i));
1671
1677
  break;
1672
1678
  } else if (this._getHelpCommand() && arg === this._getHelpCommand().name()) {
1673
- operands.push(arg);
1674
- if (args.length > 0)
1675
- operands.push(...args);
1679
+ operands.push(arg, ...args.slice(i));
1676
1680
  break;
1677
1681
  } else if (this._defaultCommandName) {
1678
- unknown.push(arg);
1679
- if (args.length > 0)
1680
- unknown.push(...args);
1682
+ unknown.push(arg, ...args.slice(i));
1681
1683
  break;
1682
1684
  }
1683
1685
  }
1684
1686
  if (this._passThroughOptions) {
1685
- dest.push(arg);
1686
- if (args.length > 0)
1687
- dest.push(...args);
1687
+ dest.push(arg, ...args.slice(i));
1688
1688
  break;
1689
1689
  }
1690
1690
  dest.push(arg);