@shell-shock/plugin-help 0.2.30 → 0.2.32

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.
@@ -2,7 +2,6 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
2
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
3
3
  let _alloy_js_core = require("@alloy-js/core");
4
4
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
5
- let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
6
5
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
7
6
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
8
7
  let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
@@ -19,10 +18,26 @@ function HelpUsageDisplay(props) {
19
18
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
20
19
  const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
21
20
  return [
22
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
23
- writeLine(
24
- textColors.body.secondary(\`\${textColors.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_snake_case.snakeCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("[command]")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : arg.type === "string" && arg.format ? (0, _stryke_string_format_snake_case.snakeCase)(arg.format) : (0, _stryke_string_format_snake_case.snakeCase)(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
21
+ (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(
22
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_snake_case.snakeCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("<command>")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : arg.type === "string" && arg.format ? (0, _stryke_string_format_snake_case.snakeCase)(arg.format) : (0, _stryke_string_format_snake_case.snakeCase)(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
25
23
  );`),
24
+ (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
25
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
26
+ get when() {
27
+ return command.alias.length > 0;
28
+ },
29
+ get children() {
30
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
31
+ get each() {
32
+ return command.alias;
33
+ },
34
+ hardline: true,
35
+ children: (alias) => _alloy_js_core.code`writeLine(
36
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${command.segments.length > 1 ? ` ${command.segments.slice(0, -1).map((segment) => `\${textColors.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_snake_case.snakeCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""} \${textColors.usage.command("${alias}")}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("<command>")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : arg.type === "string" && arg.format ? (0, _stryke_string_format_snake_case.snakeCase)(arg.format) : (0, _stryke_string_format_snake_case.snakeCase)(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
37
+ );`
38
+ });
39
+ }
40
+ }),
26
41
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
27
42
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
28
43
  get when() {
@@ -33,7 +48,7 @@ function HelpUsageDisplay(props) {
33
48
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
34
49
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
35
50
  writeLine(
36
- textColors.body.secondary(\`\${textColors.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_snake_case.snakeCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("[command]")}` : ""} \${textColors.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : arg.type === "string" && arg.format ? (0, _stryke_string_format_snake_case.snakeCase)(arg.format) : (0, _stryke_string_format_snake_case.snakeCase)(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
51
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? "dynamic" : "command"}("${(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment) ? `[${(0, _stryke_string_format_snake_case.snakeCase)((0, _shell_shock_core_plugin_utils.getDynamicPathSegmentName)(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("<command>")}` : ""} \${textColors.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => (0, _stryke_string_format_snake_case.snakeCase)(String(choice))).join("|") : arg.type === "string" && arg.format ? (0, _stryke_string_format_snake_case.snakeCase)(arg.format) : (0, _stryke_string_format_snake_case.snakeCase)(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
37
52
  );`),
38
53
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
39
54
  ];
@@ -81,7 +96,7 @@ function HelpCommandsDisplay(props) {
81
96
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
82
97
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
83
98
  get each() {
84
- return Object.values(commands);
99
+ return Object.values(commands).sort((a, b) => a.name.localeCompare(b.name));
85
100
  },
86
101
  hardline: true,
87
102
  children: (child) => _alloy_js_core.code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${(0, _shell_shock_core_plugin_utils.formatShortDescription)(child.description, { length: 200 }).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
@@ -97,7 +112,7 @@ function BaseHelpDisplay(props) {
97
112
  const { command, indent = 1, filterGlobalOptions = false } = props;
98
113
  const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
99
114
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
100
- const options = (0, _alloy_js_core.computed)(() => filterGlobalOptions ? Object.values(command.options).filter((option) => !context.globalOptions.some((globalOption) => globalOption.name === option.name || option.alias.includes(globalOption.name) || globalOption.alias?.includes(option.name) || globalOption.alias?.some((alias) => option.alias.includes(alias)))) : Object.values(command.options));
115
+ const options = (0, _alloy_js_core.computed)(() => filterGlobalOptions ? Object.values(command.options) : [...Object.values(command.options), ...context.globalOptions.filter((globalOption) => !Object.values(command.options).some((option) => option.name.toLowerCase() === globalOption.name.toLowerCase()) && !globalOption.alias.some((alias) => Object.values(command.options).some((option) => option.alias.some((a) => a.toLowerCase() === alias.toLowerCase()))))]);
101
116
  return [
102
117
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(bold(textColors.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
103
118
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
@@ -137,19 +152,6 @@ function BaseHelpDisplay(props) {
137
152
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
138
153
  ];
139
154
  }
140
- }),
141
- (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
142
- get when() {
143
- return (0, _stryke_type_checks_is_set_string.isSetString)(command.docs);
144
- },
145
- get children() {
146
- return [
147
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
148
- writeLine(textColors.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.docs}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
149
- (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
150
- (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {})
151
- ];
152
- }
153
155
  })
154
156
  ];
155
157
  }
@@ -168,7 +170,7 @@ function sortCommands(commands) {
168
170
  * A component that generates the invocation of the `help` function for a command.
169
171
  */
170
172
  function VirtualCommandHelpDisplay(props) {
171
- const { options, segments, commands } = props;
173
+ const { options, commands } = props;
172
174
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
173
175
  return [
174
176
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
@@ -196,7 +198,7 @@ function VirtualCommandHelpDisplay(props) {
196
198
  children: (child) => [
197
199
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
198
200
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
199
- writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
201
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`\${underline("${child.title}")}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
200
202
  writeLine("");
201
203
  writeLine(textColors.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
202
204
  writeLine(""); `),
@@ -208,9 +210,7 @@ function VirtualCommandHelpDisplay(props) {
208
210
  }),
209
211
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
210
212
  ]
211
- }),
212
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help(\`Running a specific command with the help flag (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help")}) or the help command with the specific command as arguments (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} help <specific command>")}) will provide additional information that is specific to that command.\`);
213
- writeLine("");`)
213
+ })
214
214
  ];
215
215
  }
216
216
  })
@@ -221,7 +221,6 @@ function VirtualCommandHelpDisplay(props) {
221
221
  */
222
222
  function CommandHelpDisplay(props) {
223
223
  const { command } = props;
224
- const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
225
224
  return [
226
225
  _alloy_js_core.code`writeLine(""); `,
227
226
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
@@ -250,7 +249,7 @@ function CommandHelpDisplay(props) {
250
249
  children: (child) => [
251
250
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
252
251
  (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
253
- writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
252
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`\${underline("${child.title}")}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
254
253
  writeLine("");
255
254
  writeLine(textColors.body.tertiary(splitText(\`${(0, _shell_shock_core_plugin_utils.formatDescription)(child.description).replace(/\.+$/, "").trim()}.\`)));
256
255
  writeLine(""); `),
@@ -262,9 +261,7 @@ function CommandHelpDisplay(props) {
262
261
  }),
263
262
  (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
264
263
  ]
265
- }),
266
- (0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`help(\`Running a specific command with the help flag (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}${command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""} <specific command> --help")}) will provide additional information that is specific to that command.\`);
267
- writeLine("");`)
264
+ })
268
265
  ];
269
266
  }
270
267
  })
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.cts","names":[],"sources":["../../src/components/display.tsx"],"mappings":";;;UAsCiB,qBAAA;;AAAjB;;EAIE,OAAA,EAAS,WAAW;EAAA;;;;;AAUd;AAMR;;EANE,MAAA;AAAA;;;;iBAMc,gBAAA,CAAiB,KAAA,EAAO,qBAAqB,4BAAA,QAAA;AAAA,UAmH5C,uBAAA;EAAA;;;EAIf,OAAA,EAAS,aAAa;AAAA;AAMxB;;;AAAA,iBAAgB,kBAAA,CAAmB,KAAA,EAAO,uBAAuB,4BAAA,QAAA;AAAA,UAoFhD,wBAAA;EApFkB;;;EAwFjC,QAAA,EAAU,MAAM,SAAS,WAAA;AAAA;;;;iBAMX,mBAAA,CAAoB,KAAA,EAAO,wBAAwB,4BAAA,QAAA;AAAA,UA2BlD,oBAAA;EAjCU;;AAAW;EAqCpC,OAAA,EAAS,WAAW;EA/Ba;;;;;;;AAAgC;EAyCjE,mBAAA;EAdmC;;;;;;;;EAwBnC,MAAA;AAAA;;;;iBAMc,eAAA,CAAgB,KAAA,EAAO,oBAAoB,4BAAA,QAAA;AAAA,UA6D1C,8BAAA;EA7D0C;;AAAA;EAiEzD,OAAA,EAAS,aAAA;EAJoC;;;EAS7C,QAAA,EAAU,MAAA,SAAe,WAAA;EAAf;;;;;;EAQV,QAAA;AAAA;;;AAAQ;iBA4CM,yBAAA,CACd,KAAA,EAAO,8BAA8B,4BAAA,QAAA;AAAA,UAwEtB,uBAAA;;;;EAIf,OAAA,EAAS,WAAW;AAAA;;AA5EiB;AAwEvC;iBAUgB,kBAAA,CAAmB,KAAA,EAAO,uBAAuB,4BAAA,QAAA"}
1
+ {"version":3,"file":"display.d.cts","names":[],"sources":["../../src/components/display.tsx"],"mappings":";;;UAqCiB,qBAAA;;AAAjB;;EAIE,OAAA,EAAS,WAAW;EAAA;;;;;AAUd;AAMR;;EANE,MAAA;AAAA;;;;iBAMc,gBAAA,CAAiB,KAAA,EAAO,qBAAqB,4BAAA,QAAA;AAAA,UA0K5C,uBAAA;EAAA;;;EAIf,OAAA,EAAS,aAAa;AAAA;AAMxB;;;AAAA,iBAAgB,kBAAA,CAAmB,KAAA,EAAO,uBAAuB,4BAAA,QAAA;AAAA,UAoFhD,wBAAA;EApFkB;;;EAwFjC,QAAA,EAAU,MAAM,SAAS,WAAA;AAAA;;;;iBAMX,mBAAA,CAAoB,KAAA,EAAO,wBAAwB,4BAAA,QAAA;AAAA,UA+BlD,oBAAA;EArCU;;AAAW;EAyCpC,OAAA,EAAS,WAAW;EAnCa;;;;;;;AAAgC;EA6CjE,mBAAA;EAdmC;;;;;;;;EAwBnC,MAAA;AAAA;;;;iBAMc,eAAA,CAAgB,KAAA,EAAO,oBAAoB,4BAAA,QAAA;AAAA,UA0D1C,8BAAA;EA1D0C;;AAAA;EA8DzD,OAAA,EAAS,aAAA;EAJoC;;;EAS7C,QAAA,EAAU,MAAA,SAAe,WAAA;EAAf;;;;;;EAQV,QAAA;AAAA;;;AAAQ;iBA4CM,yBAAA,CACd,KAAA,EAAO,8BAA8B,4BAAA,QAAA;AAAA,UA8DtB,uBAAA;;;;EAIf,OAAA,EAAS,WAAW;AAAA;;AAlEiB;AA8DvC;iBAUgB,kBAAA,CAAmB,KAAA,EAAO,uBAAuB,4BAAA,QAAA"}
@@ -1,7 +1,6 @@
1
1
  import { createComponent, createIntrinsic, memo } from "@alloy-js/core/jsx-runtime";
2
2
  import { For, Show, code, computed } from "@alloy-js/core";
3
3
  import { formatDescription, formatShortDescription, getAppBin, getAppTitle, getDynamicPathSegmentName, isDynamicPathSegment, sortOptions } from "@shell-shock/core/plugin-utils";
4
- import { isSetString } from "@stryke/type-checks/is-set-string";
5
4
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
6
5
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
7
6
  import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
@@ -18,10 +17,26 @@ function HelpUsageDisplay(props) {
18
17
  const context = usePowerlines();
19
18
  const theme = useTheme();
20
19
  return [
21
- memo(() => code`
22
- writeLine(
23
- textColors.body.secondary(\`\${textColors.usage.bin("$_ ${getAppBin(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("[command]")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => snakeCase(String(choice))).join("|") : arg.type === "string" && arg.format ? snakeCase(arg.format) : snakeCase(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
20
+ memo(() => code`writeLine(
21
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${getAppBin(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("<command>")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => snakeCase(String(choice))).join("|") : arg.type === "string" && arg.format ? snakeCase(arg.format) : snakeCase(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
24
22
  );`),
23
+ createIntrinsic("hbr", {}),
24
+ createComponent(Show, {
25
+ get when() {
26
+ return command.alias.length > 0;
27
+ },
28
+ get children() {
29
+ return createComponent(For, {
30
+ get each() {
31
+ return command.alias;
32
+ },
33
+ hardline: true,
34
+ children: (alias) => code`writeLine(
35
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${getAppBin(context)}")}${command.segments.length > 1 ? ` ${command.segments.slice(0, -1).map((segment) => `\${textColors.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}")}`).join(" ")}` : ""} \${textColors.usage.command("${alias}")}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("<command>")}` : ""}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => snakeCase(String(choice))).join("|") : arg.type === "string" && arg.format ? snakeCase(arg.format) : snakeCase(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""} \${textColors.usage.options("[options]")}\`), { padding: ${theme.padding.app * indent} }
36
+ );`
37
+ });
38
+ }
39
+ }),
25
40
  createIntrinsic("hbr", {}),
26
41
  createComponent(Show, {
27
42
  get when() {
@@ -32,7 +47,7 @@ function HelpUsageDisplay(props) {
32
47
  createIntrinsic("hbr", {}),
33
48
  memo(() => code`
34
49
  writeLine(
35
- textColors.body.secondary(\`\${textColors.usage.bin("$_ ${getAppBin(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("[command]")}` : ""} \${textColors.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => snakeCase(String(choice))).join("|") : arg.type === "string" && arg.format ? snakeCase(arg.format) : snakeCase(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
50
+ textColors.body.secondary(\`\${textColors.usage.bin("$_ ${getAppBin(context)}")}${command.segments.length > 0 ? ` ${command.segments.map((segment) => `\${textColors.usage.${isDynamicPathSegment(segment) ? "dynamic" : "command"}("${isDynamicPathSegment(segment) ? `[${snakeCase(getDynamicPathSegmentName(segment))}]` : segment}")}`).join(" ")}` : ""}${Object.values(command.children).length > 0 ? ` \${textColors.usage.dynamic("<command>")}` : ""} \${textColors.usage.options("[options]")}${command.args.length > 0 ? ` ${command.args.map((arg) => `\${textColors.usage.args("<${(arg.type === "string" || arg.type === "number") && arg.choices && arg.choices.length > 0 ? arg.choices.map((choice) => snakeCase(String(choice))).join("|") : arg.type === "string" && arg.format ? snakeCase(arg.format) : snakeCase(arg.name)}${(arg.type === "string" || arg.type === "number") && arg.variadic ? "..." : ""}>")}`).join(" ")}` : ""}\`), { padding: ${theme.padding.app * indent} }
36
51
  );`),
37
52
  createIntrinsic("hbr", {})
38
53
  ];
@@ -80,7 +95,7 @@ function HelpCommandsDisplay(props) {
80
95
  createIntrinsic("hbr", {}),
81
96
  createComponent(For, {
82
97
  get each() {
83
- return Object.values(commands);
98
+ return Object.values(commands).sort((a, b) => a.name.localeCompare(b.name));
84
99
  },
85
100
  hardline: true,
86
101
  children: (child) => code`[{ value: textColors.body.primary("${child.name}"), align: "right", border: "none" }, { value: textColors.body.tertiary(\`${formatShortDescription(child.description, { length: 200 }).replace(/\.+$/, "").trim()}.\`), align: "left", border: "none" }], `
@@ -96,7 +111,7 @@ function BaseHelpDisplay(props) {
96
111
  const { command, indent = 1, filterGlobalOptions = false } = props;
97
112
  const theme = useTheme();
98
113
  const context = usePowerlines();
99
- const options = computed(() => filterGlobalOptions ? Object.values(command.options).filter((option) => !context.globalOptions.some((globalOption) => globalOption.name === option.name || option.alias.includes(globalOption.name) || globalOption.alias?.includes(option.name) || globalOption.alias?.some((alias) => option.alias.includes(alias)))) : Object.values(command.options));
114
+ const options = computed(() => filterGlobalOptions ? Object.values(command.options) : [...Object.values(command.options), ...context.globalOptions.filter((globalOption) => !Object.values(command.options).some((option) => option.name.toLowerCase() === globalOption.name.toLowerCase()) && !globalOption.alias.some((alias) => Object.values(command.options).some((option) => option.alias.some((a) => a.toLowerCase() === alias.toLowerCase()))))]);
100
115
  return [
101
116
  memo(() => code`writeLine(bold(textColors.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
102
117
  createIntrinsic("hbr", {}),
@@ -136,19 +151,6 @@ function BaseHelpDisplay(props) {
136
151
  createComponent(Spacing, {})
137
152
  ];
138
153
  }
139
- }),
140
- createComponent(Show, {
141
- get when() {
142
- return isSetString(command.docs);
143
- },
144
- get children() {
145
- return [
146
- memo(() => code`writeLine("");
147
- writeLine(textColors.heading.tertiary(\`More information about this command can be found in the reference documentation at \${link("${command.docs}")}\`)${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
148
- createIntrinsic("hbr", {}),
149
- createComponent(Spacing, {})
150
- ];
151
- }
152
154
  })
153
155
  ];
154
156
  }
@@ -167,7 +169,7 @@ function sortCommands(commands) {
167
169
  * A component that generates the invocation of the `help` function for a command.
168
170
  */
169
171
  function VirtualCommandHelpDisplay(props) {
170
- const { options, segments, commands } = props;
172
+ const { options, commands } = props;
171
173
  const context = usePowerlines();
172
174
  return [
173
175
  createIntrinsic("hbr", {}),
@@ -195,7 +197,7 @@ function VirtualCommandHelpDisplay(props) {
195
197
  children: (child) => [
196
198
  createIntrinsic("hbr", {}),
197
199
  memo(() => code`
198
- writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
200
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`\${underline("${child.title}")}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
199
201
  writeLine("");
200
202
  writeLine(textColors.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
201
203
  writeLine(""); `),
@@ -207,9 +209,7 @@ function VirtualCommandHelpDisplay(props) {
207
209
  }),
208
210
  createIntrinsic("hbr", {})
209
211
  ]
210
- }),
211
- memo(() => code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} <specific command> --help")}) or the help command with the specific command as arguments (via: \${inlineCode("${getAppBin(context)} ${segments && segments.length > 0 ? ` ${segments.join(" ")}` : ""} help <specific command>")}) will provide additional information that is specific to that command.\`);
212
- writeLine("");`)
212
+ })
213
213
  ];
214
214
  }
215
215
  })
@@ -220,7 +220,6 @@ function VirtualCommandHelpDisplay(props) {
220
220
  */
221
221
  function CommandHelpDisplay(props) {
222
222
  const { command } = props;
223
- const context = usePowerlines();
224
223
  return [
225
224
  code`writeLine(""); `,
226
225
  createComponent(Spacing, {}),
@@ -249,7 +248,7 @@ function CommandHelpDisplay(props) {
249
248
  children: (child) => [
250
249
  createIntrinsic("hbr", {}),
251
250
  memo(() => code`
252
- writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`${child.title}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
251
+ writeLine(textColors.heading.primary(${child.icon ? `(isUnicodeSupported ? " ${child.icon} " : "") + ` : ""}\`\${underline("${child.title}")}${child.tags?.length > 0 ? ` - ${child.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}` : ""}\`));
253
252
  writeLine("");
254
253
  writeLine(textColors.body.tertiary(splitText(\`${formatDescription(child.description).replace(/\.+$/, "").trim()}.\`)));
255
254
  writeLine(""); `),
@@ -261,9 +260,7 @@ function CommandHelpDisplay(props) {
261
260
  }),
262
261
  createIntrinsic("hbr", {})
263
262
  ]
264
- }),
265
- memo(() => code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)}${command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""} <specific command> --help")}) will provide additional information that is specific to that command.\`);
266
- writeLine("");`)
263
+ })
267
264
  ];
268
265
  }
269
266
  })
@@ -4,10 +4,13 @@ const require_components_display = require('./display.cjs');
4
4
  let _alloy_js_core_jsx_runtime = require("@alloy-js/core/jsx-runtime");
5
5
  let _alloy_js_core = require("@alloy-js/core");
6
6
  let _shell_shock_core_plugin_utils = require("@shell-shock/core/plugin-utils");
7
+ let _stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
7
8
  let defu = require("defu");
8
9
  defu = require_runtime.__toESM(defu);
9
10
  let _powerlines_plugin_alloy_core_components_spacing = require("@powerlines/plugin-alloy/core/components/spacing");
10
11
  let _powerlines_plugin_alloy_core_contexts_context = require("@powerlines/plugin-alloy/core/contexts/context");
12
+ let _shell_shock_plugin_theme_contexts_theme = require("@shell-shock/plugin-theme/contexts/theme");
13
+ let _stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
11
14
  let _alloy_js_typescript = require("@alloy-js/typescript");
12
15
  let _powerlines_plugin_alloy_typescript = require("@powerlines/plugin-alloy/typescript");
13
16
  let _powerlines_plugin_alloy_typescript_components_builtin_file = require("@powerlines/plugin-alloy/typescript/components/builtin-file");
@@ -20,6 +23,7 @@ let _stryke_path = require("@stryke/path");
20
23
  function HelpBuiltin(props) {
21
24
  const [{ command, children }, rest] = (0, _alloy_js_core.splitProps)(props, ["command", "children"]);
22
25
  const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
26
+ const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
23
27
  return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_builtin_file.BuiltinFile, (0, _alloy_js_core_jsx_runtime.mergeProps)({
24
28
  get id() {
25
29
  return (0, _stryke_path.joinPaths)("help", ...command.segments.filter((segment) => !(0, _shell_shock_core_plugin_utils.isDynamicPathSegment)(segment)));
@@ -37,6 +41,7 @@ function HelpBuiltin(props) {
37
41
  "inlineCode",
38
42
  "textColors",
39
43
  "inverse",
44
+ "underline",
40
45
  "bold",
41
46
  "help",
42
47
  "table",
@@ -63,24 +68,52 @@ function HelpBuiltin(props) {
63
68
  return `Display help information for the ${command.path ? `${command.title} command` : `${(0, _shell_shock_core_plugin_utils.getAppTitle)(context, true)} application`}.`;
64
69
  },
65
70
  get children() {
66
- return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
67
- get when() {
68
- return !command.virtual;
69
- },
70
- get fallback() {
71
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_display.VirtualCommandHelpDisplay, {
72
- get options() {
73
- return Object.values(command.options);
74
- },
75
- get commands() {
76
- return command.children ?? {};
77
- }
78
- });
79
- },
80
- get children() {
81
- return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_display.CommandHelpDisplay, { command });
82
- }
83
- });
71
+ return [
72
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
73
+ get when() {
74
+ return command.tags && command.tags.length > 0;
75
+ },
76
+ get children() {
77
+ return _alloy_js_core.code`writeLine(\`\${bold(textColors.heading.secondary("Tags: "))} ${command.tags.map((tag) => `\${textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)} ? textColors.tags.${(0, _stryke_string_format_camel_case.camelCase)(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}\`, { padding: ${theme.padding.app * 2} }); `;
78
+ }
79
+ }),
80
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
81
+ get when() {
82
+ return !command.virtual;
83
+ },
84
+ get fallback() {
85
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_display.VirtualCommandHelpDisplay, {
86
+ get options() {
87
+ return Object.values(command.options);
88
+ },
89
+ get commands() {
90
+ return command.children ?? {};
91
+ }
92
+ });
93
+ },
94
+ get children() {
95
+ return (0, _alloy_js_core_jsx_runtime.createComponent)(require_components_display.CommandHelpDisplay, { command });
96
+ }
97
+ }),
98
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
99
+ get when() {
100
+ return (0, _stryke_type_checks_is_set_string.isSetString)(command.docs);
101
+ },
102
+ get children() {
103
+ return [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(textColors.body.tertiary(\`More information can be found in the ${command.path ? `${command.title} command` : (0, _shell_shock_core_plugin_utils.getAppTitle)(context, false)} documentation at \${link("${command.docs}")}\${textColors.body.tertiary(".")}\`), { padding: ${theme.padding.app * 2} });
104
+ writeLine(""); `), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
105
+ }
106
+ }),
107
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
108
+ get when() {
109
+ return Object.keys(command.children).length > 0;
110
+ },
111
+ get children() {
112
+ return _alloy_js_core.code`help(\`Running a specific command with the help flag (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)}${command.segments && command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""} <specific command> --help")}) or the help command with the specific command as arguments (via: \${inlineCode("${(0, _shell_shock_core_plugin_utils.getAppBin)(context)} ${command.segments && command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""} help <specific command>")}) will provide additional information that is specific to that command.\`);
113
+ writeLine("");`;
114
+ }
115
+ })
116
+ ];
84
117
  }
85
118
  }),
86
119
  (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_core_components_spacing.Spacing, {}),
@@ -1 +1 @@
1
- {"version":3,"file":"help-builtin.d.cts","names":[],"sources":["../../src/components/help-builtin.tsx"],"mappings":";;;;UAmCiB,gBAAA,SAAyB,IAAA,CACxC,gBAAA;;AADF;;EAOE,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,WAAA,CAAY,KAAA,EAAO,gBAAgB,4BAAA,QAAA"}
1
+ {"version":3,"file":"help-builtin.d.cts","names":[],"sources":["../../src/components/help-builtin.tsx"],"mappings":";;;;UAuCiB,gBAAA,SAAyB,IAAA,CACxC,gBAAA;;AADF;;EAOE,OAAA,EAAS,WAAA;AAAA;;;;iBAMK,WAAA,CAAY,KAAA,EAAO,gBAAgB,4BAAA,QAAA"}
@@ -1,10 +1,13 @@
1
1
  import { CommandHelpDisplay, VirtualCommandHelpDisplay } from "./display.mjs";
2
- import { createComponent, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
- import { Show, splitProps } from "@alloy-js/core";
4
- import { getAppTitle, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
2
+ import { createComponent, createIntrinsic, memo, mergeProps } from "@alloy-js/core/jsx-runtime";
3
+ import { Show, code, splitProps } from "@alloy-js/core";
4
+ import { getAppBin, getAppTitle, isDynamicPathSegment } from "@shell-shock/core/plugin-utils";
5
+ import { isSetString } from "@stryke/type-checks/is-set-string";
5
6
  import defu from "defu";
6
7
  import { Spacing } from "@powerlines/plugin-alloy/core/components/spacing";
7
8
  import { usePowerlines } from "@powerlines/plugin-alloy/core/contexts/context";
9
+ import { useTheme } from "@shell-shock/plugin-theme/contexts/theme";
10
+ import { camelCase } from "@stryke/string-format/camel-case";
8
11
  import { FunctionDeclaration } from "@alloy-js/typescript";
9
12
  import { TSDoc, TSDocRemarks } from "@powerlines/plugin-alloy/typescript";
10
13
  import { BuiltinFile } from "@powerlines/plugin-alloy/typescript/components/builtin-file";
@@ -17,6 +20,7 @@ import { joinPaths } from "@stryke/path";
17
20
  function HelpBuiltin(props) {
18
21
  const [{ command, children }, rest] = splitProps(props, ["command", "children"]);
19
22
  const context = usePowerlines();
23
+ const theme = useTheme();
20
24
  return createComponent(BuiltinFile, mergeProps({
21
25
  get id() {
22
26
  return joinPaths("help", ...command.segments.filter((segment) => !isDynamicPathSegment(segment)));
@@ -34,6 +38,7 @@ function HelpBuiltin(props) {
34
38
  "inlineCode",
35
39
  "textColors",
36
40
  "inverse",
41
+ "underline",
37
42
  "bold",
38
43
  "help",
39
44
  "table",
@@ -60,24 +65,52 @@ function HelpBuiltin(props) {
60
65
  return `Display help information for the ${command.path ? `${command.title} command` : `${getAppTitle(context, true)} application`}.`;
61
66
  },
62
67
  get children() {
63
- return createComponent(Show, {
64
- get when() {
65
- return !command.virtual;
66
- },
67
- get fallback() {
68
- return createComponent(VirtualCommandHelpDisplay, {
69
- get options() {
70
- return Object.values(command.options);
71
- },
72
- get commands() {
73
- return command.children ?? {};
74
- }
75
- });
76
- },
77
- get children() {
78
- return createComponent(CommandHelpDisplay, { command });
79
- }
80
- });
68
+ return [
69
+ createComponent(Show, {
70
+ get when() {
71
+ return command.tags && command.tags.length > 0;
72
+ },
73
+ get children() {
74
+ return code`writeLine(\`\${bold(textColors.heading.secondary("Tags: "))} ${command.tags.map((tag) => `\${textColors.tags.${camelCase(tag)} ? textColors.tags.${camelCase(tag)}(inverse(" ${tag} ")) : textColors.tags.$default(inverse(" ${tag} "))}`).join(" ")}\`, { padding: ${theme.padding.app * 2} }); `;
75
+ }
76
+ }),
77
+ createComponent(Show, {
78
+ get when() {
79
+ return !command.virtual;
80
+ },
81
+ get fallback() {
82
+ return createComponent(VirtualCommandHelpDisplay, {
83
+ get options() {
84
+ return Object.values(command.options);
85
+ },
86
+ get commands() {
87
+ return command.children ?? {};
88
+ }
89
+ });
90
+ },
91
+ get children() {
92
+ return createComponent(CommandHelpDisplay, { command });
93
+ }
94
+ }),
95
+ createComponent(Show, {
96
+ get when() {
97
+ return isSetString(command.docs);
98
+ },
99
+ get children() {
100
+ return [memo(() => code`writeLine(textColors.body.tertiary(\`More information can be found in the ${command.path ? `${command.title} command` : getAppTitle(context, false)} documentation at \${link("${command.docs}")}\${textColors.body.tertiary(".")}\`), { padding: ${theme.padding.app * 2} });
101
+ writeLine(""); `), createIntrinsic("hbr", {})];
102
+ }
103
+ }),
104
+ createComponent(Show, {
105
+ get when() {
106
+ return Object.keys(command.children).length > 0;
107
+ },
108
+ get children() {
109
+ return code`help(\`Running a specific command with the help flag (via: \${inlineCode("${getAppBin(context)}${command.segments && command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""} <specific command> --help")}) or the help command with the specific command as arguments (via: \${inlineCode("${getAppBin(context)} ${command.segments && command.segments.length > 0 ? ` ${command.segments.join(" ")}` : ""} help <specific command>")}) will provide additional information that is specific to that command.\`);
110
+ writeLine("");`;
111
+ }
112
+ })
113
+ ];
81
114
  }
82
115
  }),
83
116
  createComponent(Spacing, {}),
@@ -78,6 +78,7 @@ function HelpCommand(props) {
78
78
  "inlineCode",
79
79
  "textColors",
80
80
  "inverse",
81
+ "underline",
81
82
  "bold",
82
83
  "help",
83
84
  "table",
@@ -77,6 +77,7 @@ function HelpCommand(props) {
77
77
  "inlineCode",
78
78
  "textColors",
79
79
  "inverse",
80
+ "underline",
80
81
  "bold",
81
82
  "help",
82
83
  "table",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shell-shock/plugin-help",
3
- "version": "0.2.30",
3
+ "version": "0.2.32",
4
4
  "private": false,
5
5
  "description": "A package containing a Shell Shock plugin to provide help and documentation for the local application's commands.",
6
6
  "keywords": [
@@ -153,24 +153,24 @@
153
153
  "dependencies": {
154
154
  "@alloy-js/core": "^0.23.1",
155
155
  "@alloy-js/typescript": "^0.23.0",
156
- "@powerlines/deepkit": "^0.9.80",
157
- "@powerlines/plugin-alloy": "^0.26.219",
158
- "@powerlines/plugin-plugin": "^0.12.538",
159
- "@shell-shock/core": "0.17.12",
160
- "@shell-shock/plugin-console": "0.2.16",
161
- "@shell-shock/plugin-theme": "0.4.25",
156
+ "@powerlines/deepkit": "^0.9.81",
157
+ "@powerlines/plugin-alloy": "^0.26.220",
158
+ "@powerlines/plugin-plugin": "^0.12.539",
159
+ "@shell-shock/core": "0.17.14",
160
+ "@shell-shock/plugin-console": "0.2.18",
161
+ "@shell-shock/plugin-theme": "0.4.27",
162
162
  "@stryke/helpers": "^0.10.24",
163
163
  "@stryke/path": "^0.29.11",
164
164
  "@stryke/string-format": "^0.17.26",
165
165
  "@stryke/type-checks": "^0.6.17",
166
166
  "@stryke/types": "^0.12.12",
167
167
  "defu": "^6.1.7",
168
- "powerlines": "^0.47.126"
168
+ "powerlines": "^0.47.127"
169
169
  },
170
170
  "devDependencies": {
171
- "@powerlines/plugin-deepkit": "^0.11.469",
171
+ "@powerlines/plugin-deepkit": "^0.11.470",
172
172
  "@types/node": "^25.9.1"
173
173
  },
174
174
  "publishConfig": { "access": "public" },
175
- "gitHead": "3c10901dd3fbbc3c9d6d1a3373f01cc5f56d3321"
175
+ "gitHead": "484e42bc94f3641bd1c2fdfd8c13ad22898be16d"
176
176
  }