@robinmordasiewicz/f5xc-xcsh 1.0.91-2601040346 → 1.0.91-2601040531

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 (2) hide show
  1. package/dist/index.js +29 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -47052,8 +47052,8 @@ function getLogoModeFromEnv(envPrefix) {
47052
47052
  var CLI_NAME = "xcsh";
47053
47053
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
47054
47054
  function getVersion() {
47055
- if ("v1.0.91-2601040346") {
47056
- return "v1.0.91-2601040346";
47055
+ if ("v1.0.91-2601040531") {
47056
+ return "v1.0.91-2601040531";
47057
47057
  }
47058
47058
  if (process.env.XCSH_VERSION) {
47059
47059
  return process.env.XCSH_VERSION;
@@ -47964,7 +47964,13 @@ function getValue(row, accessor) {
47964
47964
  if (typeof accessor === "function") {
47965
47965
  return accessor(row);
47966
47966
  }
47967
- const value = row[accessor];
47967
+ let value = row[accessor];
47968
+ if (value === null || value === void 0) {
47969
+ const metadata = row["metadata"];
47970
+ if (metadata && typeof metadata === "object") {
47971
+ value = metadata[accessor];
47972
+ }
47973
+ }
47968
47974
  if (value === null || value === void 0) {
47969
47975
  return "";
47970
47976
  }
@@ -152956,6 +152962,7 @@ function parseCommandArgs(args, domainResourceTypes) {
152956
152962
  let spec = false;
152957
152963
  let noColor = false;
152958
152964
  let positionalIndex = 0;
152965
+ const consumedAsValue = /* @__PURE__ */ new Set();
152959
152966
  for (let i = 0; i < args.length; i++) {
152960
152967
  const arg = args[i] ?? "";
152961
152968
  if (arg.startsWith("--")) {
@@ -152965,15 +152972,18 @@ function parseCommandArgs(args, domainResourceTypes) {
152965
152972
  case "namespace":
152966
152973
  case "ns":
152967
152974
  namespace = nextArg;
152975
+ consumedAsValue.add(i + 1);
152968
152976
  i++;
152969
152977
  break;
152970
152978
  case "name":
152971
152979
  name = nextArg;
152980
+ consumedAsValue.add(i + 1);
152972
152981
  i++;
152973
152982
  break;
152974
152983
  case "output":
152975
152984
  if (nextArg) {
152976
152985
  outputFormat = parseOutputFormat(nextArg);
152986
+ consumedAsValue.add(i + 1);
152977
152987
  i++;
152978
152988
  }
152979
152989
  break;
@@ -152985,6 +152995,7 @@ function parseCommandArgs(args, domainResourceTypes) {
152985
152995
  break;
152986
152996
  default:
152987
152997
  if (nextArg && !nextArg.startsWith("--")) {
152998
+ consumedAsValue.add(i + 1);
152988
152999
  i++;
152989
153000
  }
152990
153001
  }
@@ -152995,16 +153006,19 @@ function parseCommandArgs(args, domainResourceTypes) {
152995
153006
  case "n":
152996
153007
  case "ns":
152997
153008
  namespace = nextArg;
153009
+ consumedAsValue.add(i + 1);
152998
153010
  i++;
152999
153011
  break;
153000
153012
  case "o":
153001
153013
  if (nextArg) {
153002
153014
  outputFormat = parseOutputFormat(nextArg);
153015
+ consumedAsValue.add(i + 1);
153003
153016
  i++;
153004
153017
  }
153005
153018
  break;
153006
153019
  default:
153007
153020
  if (nextArg && !nextArg.startsWith("-")) {
153021
+ consumedAsValue.add(i + 1);
153008
153022
  i++;
153009
153023
  }
153010
153024
  }
@@ -153021,6 +153035,18 @@ function parseCommandArgs(args, domainResourceTypes) {
153021
153035
  positionalIndex++;
153022
153036
  }
153023
153037
  }
153038
+ if (!name && resourceType) {
153039
+ const remainingPositionals = [];
153040
+ for (let i = 0; i < args.length; i++) {
153041
+ const arg = args[i] ?? "";
153042
+ if (!arg.startsWith("-") && !consumedAsValue.has(i) && arg.toLowerCase() !== resourceType) {
153043
+ remainingPositionals.push(arg);
153044
+ }
153045
+ }
153046
+ if (remainingPositionals.length > 0) {
153047
+ name = remainingPositionals[remainingPositionals.length - 1];
153048
+ }
153049
+ }
153024
153050
  return { resourceType, name, namespace, outputFormat, spec, noColor };
153025
153051
  }
153026
153052
  async function executeAPICommand(session, ctx, cmd) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "1.0.91-2601040346",
3
+ "version": "1.0.91-2601040531",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {