@robinmordasiewicz/f5xc-xcsh 6.40.0 → 6.41.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.
Files changed (2) hide show
  1. package/dist/index.js +28 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -45354,8 +45354,8 @@ function getLogoModeFromEnv(envPrefix) {
45354
45354
  var CLI_NAME = "xcsh";
45355
45355
  var CLI_FULL_NAME = "F5 Distributed Cloud Shell";
45356
45356
  function getVersion() {
45357
- if ("6.40.0") {
45358
- return "6.40.0";
45357
+ if ("6.41.0") {
45358
+ return "6.41.0";
45359
45359
  }
45360
45360
  if (process.env.XCSH_VERSION) {
45361
45361
  return process.env.XCSH_VERSION;
@@ -49024,6 +49024,21 @@ function colorizeLogoLine(line) {
49024
49024
  }
49025
49025
  return result;
49026
49026
  }
49027
+ function wrapText4(text, maxWidth) {
49028
+ const words = text.split(" ");
49029
+ const lines = [];
49030
+ let currentLine = "";
49031
+ for (const word of words) {
49032
+ if (currentLine.length + word.length + 1 <= maxWidth) {
49033
+ currentLine += (currentLine ? " " : "") + word;
49034
+ } else {
49035
+ if (currentLine) lines.push(currentLine);
49036
+ currentLine = word;
49037
+ }
49038
+ }
49039
+ if (currentLine) lines.push(currentLine);
49040
+ return lines;
49041
+ }
49027
49042
  function printImageBanner(imageSeq, imageHeight, imageWidth) {
49028
49043
  const BOX = {
49029
49044
  topLeft: "\u256D",
@@ -49037,11 +49052,7 @@ function printImageBanner(imageSeq, imageHeight, imageWidth) {
49037
49052
  const INNER_WIDTH = TOTAL_WIDTH - 2;
49038
49053
  const IMAGE_COL_WIDTH = 1 + imageWidth + 1;
49039
49054
  const TEXT_COL_WIDTH = INNER_WIDTH - IMAGE_COL_WIDTH;
49040
- const HELP_LINES = [
49041
- "Type 'help' for commands",
49042
- "Run 'namespace <ns>' to set",
49043
- "Press Ctrl+C twice to exit"
49044
- ];
49055
+ const HELP_LINES = wrapText4(CLI_DESCRIPTION_MEDIUM, TEXT_COL_WIDTH - 2);
49045
49056
  const helpStartRow = Math.floor((imageHeight - HELP_LINES.length) / 2);
49046
49057
  const title = ` ${CLI_FULL_NAME} v${CLI_VERSION} `;
49047
49058
  const leftDashes = 3;
@@ -49091,11 +49102,8 @@ function printAsciiBanner() {
49091
49102
  const logoWidth = Math.max(...logoLines.map((l) => [...l].length));
49092
49103
  const TOTAL_WIDTH = Math.max(80, logoWidth + 4);
49093
49104
  const INNER_WIDTH = TOTAL_WIDTH - 2;
49094
- const HELP_LINES = [
49095
- "Type 'help' for commands",
49096
- "Run 'namespace <ns>' to set",
49097
- "Press Ctrl+C twice to exit"
49098
- ];
49105
+ const helpColumnWidth = INNER_WIDTH - logoWidth - 1;
49106
+ const HELP_LINES = wrapText4(CLI_DESCRIPTION_MEDIUM, helpColumnWidth - 2);
49099
49107
  const HELP_START_ROW = 8;
49100
49108
  const title = ` ${CLI_FULL_NAME} v${CLI_VERSION} `;
49101
49109
  const leftDashes = 3;
@@ -49112,7 +49120,6 @@ function printAsciiBanner() {
49112
49120
  const helpText = helpIndex >= 0 && helpIndex < HELP_LINES.length ? HELP_LINES[helpIndex] ?? "" : "";
49113
49121
  const paddedLogo = logoLine.padEnd(logoWidth);
49114
49122
  const coloredLogo = colorizeLogoLine(paddedLogo);
49115
- const helpColumnWidth = INNER_WIDTH - logoWidth - 1;
49116
49123
  const paddedHelp = helpText.padEnd(helpColumnWidth);
49117
49124
  output.push(
49118
49125
  colorRed(BOX.vertical) + coloredLogo + " " + colorBoldWhite(paddedHelp) + colorRed(BOX.vertical)
@@ -49143,11 +49150,7 @@ function getBannerLines(logoMode, useImage) {
49143
49150
  const logoWidth = Math.max(...logoLines.map((l) => [...l].length));
49144
49151
  const TOTAL_WIDTH = Math.max(80, logoWidth + 4);
49145
49152
  const INNER_WIDTH = TOTAL_WIDTH - 2;
49146
- const HELP_LINES = [
49147
- "Type 'help' for commands",
49148
- "Run 'namespace <ns>' to set",
49149
- "Press Ctrl+C twice to exit"
49150
- ];
49153
+ const helpColumnWidth = INNER_WIDTH - logoWidth - 1;
49151
49154
  const title = ` ${CLI_FULL_NAME} v${CLI_VERSION} `;
49152
49155
  const leftDashes = 3;
49153
49156
  const rightDashes = TOTAL_WIDTH - 1 - leftDashes - title.length - 1;
@@ -49168,8 +49171,12 @@ function getBannerLines(logoMode, useImage) {
49168
49171
  const imageWidth = F5_LOGO_DISPLAY_WIDTH;
49169
49172
  const IMAGE_COL_WIDTH = 1 + imageWidth + 1;
49170
49173
  const TEXT_COL_WIDTH = INNER_WIDTH - IMAGE_COL_WIDTH;
49174
+ const HELP_LINES2 = wrapText4(
49175
+ CLI_DESCRIPTION_MEDIUM,
49176
+ TEXT_COL_WIDTH - 2
49177
+ );
49171
49178
  const helpStartRow = Math.floor(
49172
- (imageHeight - HELP_LINES.length) / 2
49179
+ (imageHeight - HELP_LINES2.length) / 2
49173
49180
  );
49174
49181
  let bannerStr = "";
49175
49182
  bannerStr += "\n";
@@ -49179,7 +49186,7 @@ function getBannerLines(logoMode, useImage) {
49179
49186
  bannerStr += colorRed(BOX.vertical) + " ".repeat(INNER_WIDTH) + colorRed(BOX.vertical) + "\n";
49180
49187
  for (let row = 0; row < imageHeight; row++) {
49181
49188
  const helpIndex = row - helpStartRow;
49182
- const helpText = helpIndex >= 0 && helpIndex < HELP_LINES.length ? HELP_LINES[helpIndex] ?? "" : "";
49189
+ const helpText = helpIndex >= 0 && helpIndex < HELP_LINES2.length ? HELP_LINES2[helpIndex] ?? "" : "";
49183
49190
  const imageSpace = " ".repeat(IMAGE_COL_WIDTH);
49184
49191
  const paddedHelp = helpText.padEnd(TEXT_COL_WIDTH);
49185
49192
  bannerStr += colorRed(BOX.vertical) + imageSpace + colorBoldWhite(paddedHelp) + colorRed(BOX.vertical) + "\n";
@@ -49198,6 +49205,7 @@ function getBannerLines(logoMode, useImage) {
49198
49205
  }
49199
49206
  }
49200
49207
  const HELP_START_ROW = 8;
49208
+ const HELP_LINES = wrapText4(CLI_DESCRIPTION_MEDIUM, helpColumnWidth - 2);
49201
49209
  output.push("");
49202
49210
  output.push(
49203
49211
  colorRed(BOX.topLeft + BOX.horizontal.repeat(leftDashes)) + colorBoldWhite(title) + colorRed(
@@ -49210,7 +49218,6 @@ function getBannerLines(logoMode, useImage) {
49210
49218
  const helpText = helpIndex >= 0 && helpIndex < HELP_LINES.length ? HELP_LINES[helpIndex] ?? "" : "";
49211
49219
  const paddedLogo = logoLine.padEnd(logoWidth);
49212
49220
  const coloredLogo = colorizeLogoLine(paddedLogo);
49213
- const helpColumnWidth = INNER_WIDTH - logoWidth - 1;
49214
49221
  const paddedHelp = helpText.padEnd(helpColumnWidth);
49215
49222
  output.push(
49216
49223
  colorRed(BOX.vertical) + coloredLogo + " " + colorBoldWhite(paddedHelp) + colorRed(BOX.vertical)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinmordasiewicz/f5xc-xcsh",
3
- "version": "6.40.0",
3
+ "version": "6.41.0",
4
4
  "description": "F5 Distributed Cloud Shell - Interactive CLI for F5 XC",
5
5
  "type": "module",
6
6
  "bin": {