@shell-shock/plugin-help 0.2.34 → 0.2.36
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/dist/components/display.cjs +38 -24
- package/dist/components/display.d.cts.map +1 -1
- package/dist/components/display.mjs +38 -24
- package/dist/components/help-builtin.cjs +2 -2
- package/dist/components/help-builtin.mjs +2 -2
- package/dist/components/help-command.cjs +14 -14
- package/dist/components/help-command.mjs +14 -14
- package/package.json +5 -5
|
@@ -19,25 +19,8 @@ function HelpUsageDisplay(props) {
|
|
|
19
19
|
const theme = (0, _shell_shock_plugin_theme_contexts_theme.useTheme)();
|
|
20
20
|
return [
|
|
21
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} }
|
|
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 ?? 1) * indent} }
|
|
23
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
|
-
}),
|
|
41
24
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
42
25
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
43
26
|
get when() {
|
|
@@ -48,12 +31,43 @@ function HelpUsageDisplay(props) {
|
|
|
48
31
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
49
32
|
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
|
|
50
33
|
writeLine(
|
|
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} }
|
|
34
|
+
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 ?? 1) * indent} }
|
|
52
35
|
);`),
|
|
53
36
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
54
37
|
];
|
|
55
38
|
}
|
|
56
|
-
})
|
|
39
|
+
}),
|
|
40
|
+
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
41
|
+
get when() {
|
|
42
|
+
return command.alias.length > 0;
|
|
43
|
+
},
|
|
44
|
+
get children() {
|
|
45
|
+
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
46
|
+
get each() {
|
|
47
|
+
return command.alias;
|
|
48
|
+
},
|
|
49
|
+
hardline: true,
|
|
50
|
+
children: (alias) => [(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(
|
|
51
|
+
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 ?? 1) * indent} }
|
|
52
|
+
);`), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
53
|
+
get when() {
|
|
54
|
+
return command.args.length > 0;
|
|
55
|
+
},
|
|
56
|
+
get children() {
|
|
57
|
+
return [
|
|
58
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
59
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`
|
|
60
|
+
writeLine(
|
|
61
|
+
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>")}` : ""} \${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 ?? 1) * indent} }
|
|
62
|
+
);`),
|
|
63
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
})]
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}),
|
|
70
|
+
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})
|
|
57
71
|
];
|
|
58
72
|
}
|
|
59
73
|
/**
|
|
@@ -67,7 +81,7 @@ function HelpOptionsDisplay(props) {
|
|
|
67
81
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
68
82
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
69
83
|
get each() {
|
|
70
|
-
return (0, _shell_shock_core_plugin_utils.sortOptions)(options);
|
|
84
|
+
return (0, _shell_shock_core_plugin_utils.sortOptions)(options, false);
|
|
71
85
|
},
|
|
72
86
|
hardline: true,
|
|
73
87
|
children: (option) => {
|
|
@@ -114,7 +128,7 @@ function BaseHelpDisplay(props) {
|
|
|
114
128
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
115
129
|
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()))))]);
|
|
116
130
|
return [
|
|
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} }` : ""});`),
|
|
131
|
+
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine(bold(textColors.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${(theme.padding.app ?? 1) * indent} }` : ""});`),
|
|
118
132
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
119
133
|
(0, _alloy_js_core_jsx_runtime.createComponent)(HelpUsageDisplay, {
|
|
120
134
|
command,
|
|
@@ -128,7 +142,7 @@ function BaseHelpDisplay(props) {
|
|
|
128
142
|
get children() {
|
|
129
143
|
return [
|
|
130
144
|
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
|
|
131
|
-
writeLine(bold(textColors.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
145
|
+
writeLine(bold(textColors.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${(theme.padding.app ?? 1) * indent} }` : ""});`),
|
|
132
146
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
133
147
|
(0, _alloy_js_core_jsx_runtime.createComponent)(HelpOptionsDisplay, { get options() {
|
|
134
148
|
return options.value;
|
|
@@ -144,7 +158,7 @@ function BaseHelpDisplay(props) {
|
|
|
144
158
|
get children() {
|
|
145
159
|
return [
|
|
146
160
|
(0, _alloy_js_core_jsx_runtime.memo)(() => _alloy_js_core.code`writeLine("");
|
|
147
|
-
writeLine(bold(textColors.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
161
|
+
writeLine(bold(textColors.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${(theme.padding.app ?? 1) * indent} }` : ""});`),
|
|
148
162
|
(0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {}),
|
|
149
163
|
(0, _alloy_js_core_jsx_runtime.createComponent)(HelpCommandsDisplay, { get commands() {
|
|
150
164
|
return command.children;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,UAkO5C,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"}
|
|
@@ -18,25 +18,8 @@ function HelpUsageDisplay(props) {
|
|
|
18
18
|
const theme = useTheme();
|
|
19
19
|
return [
|
|
20
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} }
|
|
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 ?? 1) * indent} }
|
|
22
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
|
-
}),
|
|
40
23
|
createIntrinsic("hbr", {}),
|
|
41
24
|
createComponent(Show, {
|
|
42
25
|
get when() {
|
|
@@ -47,12 +30,43 @@ function HelpUsageDisplay(props) {
|
|
|
47
30
|
createIntrinsic("hbr", {}),
|
|
48
31
|
memo(() => code`
|
|
49
32
|
writeLine(
|
|
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} }
|
|
33
|
+
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 ?? 1) * indent} }
|
|
51
34
|
);`),
|
|
52
35
|
createIntrinsic("hbr", {})
|
|
53
36
|
];
|
|
54
37
|
}
|
|
55
|
-
})
|
|
38
|
+
}),
|
|
39
|
+
createComponent(Show, {
|
|
40
|
+
get when() {
|
|
41
|
+
return command.alias.length > 0;
|
|
42
|
+
},
|
|
43
|
+
get children() {
|
|
44
|
+
return createComponent(For, {
|
|
45
|
+
get each() {
|
|
46
|
+
return command.alias;
|
|
47
|
+
},
|
|
48
|
+
hardline: true,
|
|
49
|
+
children: (alias) => [memo(() => code`writeLine(
|
|
50
|
+
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 ?? 1) * indent} }
|
|
51
|
+
);`), createComponent(Show, {
|
|
52
|
+
get when() {
|
|
53
|
+
return command.args.length > 0;
|
|
54
|
+
},
|
|
55
|
+
get children() {
|
|
56
|
+
return [
|
|
57
|
+
createIntrinsic("hbr", {}),
|
|
58
|
+
memo(() => code`
|
|
59
|
+
writeLine(
|
|
60
|
+
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>")}` : ""} \${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 ?? 1) * indent} }
|
|
61
|
+
);`),
|
|
62
|
+
createIntrinsic("hbr", {})
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
})]
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
}),
|
|
69
|
+
createIntrinsic("hbr", {})
|
|
56
70
|
];
|
|
57
71
|
}
|
|
58
72
|
/**
|
|
@@ -66,7 +80,7 @@ function HelpOptionsDisplay(props) {
|
|
|
66
80
|
createIntrinsic("hbr", {}),
|
|
67
81
|
createComponent(For, {
|
|
68
82
|
get each() {
|
|
69
|
-
return sortOptions(options);
|
|
83
|
+
return sortOptions(options, false);
|
|
70
84
|
},
|
|
71
85
|
hardline: true,
|
|
72
86
|
children: (option) => {
|
|
@@ -113,7 +127,7 @@ function BaseHelpDisplay(props) {
|
|
|
113
127
|
const context = usePowerlines();
|
|
114
128
|
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()))))]);
|
|
115
129
|
return [
|
|
116
|
-
memo(() => code`writeLine(bold(textColors.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
130
|
+
memo(() => code`writeLine(bold(textColors.heading.secondary("Usage:"))${indent > 1 ? `, { padding: ${(theme.padding.app ?? 1) * indent} }` : ""});`),
|
|
117
131
|
createIntrinsic("hbr", {}),
|
|
118
132
|
createComponent(HelpUsageDisplay, {
|
|
119
133
|
command,
|
|
@@ -127,7 +141,7 @@ function BaseHelpDisplay(props) {
|
|
|
127
141
|
get children() {
|
|
128
142
|
return [
|
|
129
143
|
memo(() => code`writeLine("");
|
|
130
|
-
writeLine(bold(textColors.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
144
|
+
writeLine(bold(textColors.heading.secondary("Options:"))${indent > 1 ? `, { padding: ${(theme.padding.app ?? 1) * indent} }` : ""});`),
|
|
131
145
|
createIntrinsic("hbr", {}),
|
|
132
146
|
createComponent(HelpOptionsDisplay, { get options() {
|
|
133
147
|
return options.value;
|
|
@@ -143,7 +157,7 @@ function BaseHelpDisplay(props) {
|
|
|
143
157
|
get children() {
|
|
144
158
|
return [
|
|
145
159
|
memo(() => code`writeLine("");
|
|
146
|
-
writeLine(bold(textColors.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${theme.padding.app * indent} }` : ""});`),
|
|
160
|
+
writeLine(bold(textColors.heading.secondary("Commands:"))${indent > 1 ? `, { padding: ${(theme.padding.app ?? 1) * indent} }` : ""});`),
|
|
147
161
|
createIntrinsic("hbr", {}),
|
|
148
162
|
createComponent(HelpCommandsDisplay, { get commands() {
|
|
149
163
|
return command.children;
|
|
@@ -74,7 +74,7 @@ function HelpBuiltin(props) {
|
|
|
74
74
|
return command.tags && command.tags.length > 0;
|
|
75
75
|
},
|
|
76
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} }); `;
|
|
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 ?? 1) * 2} }); `;
|
|
78
78
|
}
|
|
79
79
|
}),
|
|
80
80
|
(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
@@ -100,7 +100,7 @@ function HelpBuiltin(props) {
|
|
|
100
100
|
return (0, _stryke_type_checks_is_set_string.isSetString)(command.docs);
|
|
101
101
|
},
|
|
102
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} });
|
|
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 ?? 1) * 2} });
|
|
104
104
|
writeLine(""); `), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
|
|
105
105
|
}
|
|
106
106
|
}),
|
|
@@ -71,7 +71,7 @@ function HelpBuiltin(props) {
|
|
|
71
71
|
return command.tags && command.tags.length > 0;
|
|
72
72
|
},
|
|
73
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} }); `;
|
|
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 ?? 1) * 2} }); `;
|
|
75
75
|
}
|
|
76
76
|
}),
|
|
77
77
|
createComponent(Show, {
|
|
@@ -97,7 +97,7 @@ function HelpBuiltin(props) {
|
|
|
97
97
|
return isSetString(command.docs);
|
|
98
98
|
},
|
|
99
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} });
|
|
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 ?? 1) * 2} });
|
|
101
101
|
writeLine(""); `), createIntrinsic("hbr", {})];
|
|
102
102
|
}
|
|
103
103
|
}),
|
|
@@ -27,8 +27,8 @@ function TemporaryHelpCommand() {
|
|
|
27
27
|
heading: "Display command usage details and other useful information to the user.",
|
|
28
28
|
get children() {
|
|
29
29
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
30
|
-
name: "
|
|
31
|
-
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no
|
|
30
|
+
name: "commands",
|
|
31
|
+
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no commands are provided, general help information about the CLI application will be displayed.`
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
}),
|
|
@@ -38,7 +38,7 @@ function TemporaryHelpCommand() {
|
|
|
38
38
|
async: true,
|
|
39
39
|
name: "handler",
|
|
40
40
|
parameters: [{
|
|
41
|
-
name: "
|
|
41
|
+
name: "commands",
|
|
42
42
|
type: "string[]",
|
|
43
43
|
default: "[]"
|
|
44
44
|
}]
|
|
@@ -52,10 +52,10 @@ function TemporaryHelpCommand() {
|
|
|
52
52
|
*/
|
|
53
53
|
function HelpCommand(props) {
|
|
54
54
|
const context = (0, _powerlines_plugin_alloy_core_contexts_context.usePowerlines)();
|
|
55
|
-
const helpImports = (0, _alloy_js_core.computed)(() => props.commands ? props.commands.reduce((ret,
|
|
56
|
-
ret[(0, _stryke_path.joinPaths)("help", ...
|
|
55
|
+
const helpImports = (0, _alloy_js_core.computed)(() => props.commands ? props.commands.reduce((ret, commands) => {
|
|
56
|
+
ret[(0, _stryke_path.joinPaths)("help", ...commands)] = [{
|
|
57
57
|
name: "showHelp",
|
|
58
|
-
alias: `showHelp${
|
|
58
|
+
alias: `showHelp${commands.map((command) => (0, _stryke_string_format_pascal_case.pascalCase)(command.replace(/-/g, ""))).join("")}`
|
|
59
59
|
}];
|
|
60
60
|
return ret;
|
|
61
61
|
}, {}) : {});
|
|
@@ -91,8 +91,8 @@ function HelpCommand(props) {
|
|
|
91
91
|
heading: "Display command usage details and other useful information to the user.",
|
|
92
92
|
get children() {
|
|
93
93
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_powerlines_plugin_alloy_typescript_components_tsdoc.TSDocParam, {
|
|
94
|
-
name: "
|
|
95
|
-
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no
|
|
94
|
+
name: "commands",
|
|
95
|
+
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no commands are provided, general help information about the CLI application will be displayed.`
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
}), (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.FunctionDeclaration, {
|
|
@@ -101,7 +101,7 @@ function HelpCommand(props) {
|
|
|
101
101
|
async: true,
|
|
102
102
|
name: "handler",
|
|
103
103
|
parameters: [{
|
|
104
|
-
name: "
|
|
104
|
+
name: "commands",
|
|
105
105
|
type: "string[]",
|
|
106
106
|
default: "[]"
|
|
107
107
|
}],
|
|
@@ -115,25 +115,25 @@ function HelpCommand(props) {
|
|
|
115
115
|
return [(0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.For, {
|
|
116
116
|
each: commandSegmentsList,
|
|
117
117
|
doubleHardline: true,
|
|
118
|
-
children: (
|
|
118
|
+
children: (commands, index) => (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
|
|
119
119
|
when: index > 0,
|
|
120
120
|
get fallback() {
|
|
121
121
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.IfStatement, {
|
|
122
122
|
get condition() {
|
|
123
|
-
return _alloy_js_core.code`
|
|
123
|
+
return _alloy_js_core.code`commands.join("/").toLowerCase() === "${commands.join("/").toLowerCase()}"`;
|
|
124
124
|
},
|
|
125
125
|
get children() {
|
|
126
|
-
return _alloy_js_core.code` showHelp${
|
|
126
|
+
return _alloy_js_core.code` showHelp${commands.map((command) => (0, _stryke_string_format_pascal_case.pascalCase)(command)).join("")}(); `;
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
},
|
|
130
130
|
get children() {
|
|
131
131
|
return (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_typescript.ElseIfClause, {
|
|
132
132
|
get condition() {
|
|
133
|
-
return _alloy_js_core.code`
|
|
133
|
+
return _alloy_js_core.code`commands.join("/").toLowerCase() === "${commands.join("/").toLowerCase()}"`;
|
|
134
134
|
},
|
|
135
135
|
get children() {
|
|
136
|
-
return _alloy_js_core.code` showHelp${
|
|
136
|
+
return _alloy_js_core.code` showHelp${commands.map((command) => (0, _stryke_string_format_pascal_case.pascalCase)(command)).join("")}(); `;
|
|
137
137
|
}
|
|
138
138
|
});
|
|
139
139
|
}
|
|
@@ -26,8 +26,8 @@ function TemporaryHelpCommand() {
|
|
|
26
26
|
heading: "Display command usage details and other useful information to the user.",
|
|
27
27
|
get children() {
|
|
28
28
|
return createComponent(TSDocParam, {
|
|
29
|
-
name: "
|
|
30
|
-
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no
|
|
29
|
+
name: "commands",
|
|
30
|
+
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no commands are provided, general help information about the CLI application will be displayed.`
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
}),
|
|
@@ -37,7 +37,7 @@ function TemporaryHelpCommand() {
|
|
|
37
37
|
async: true,
|
|
38
38
|
name: "handler",
|
|
39
39
|
parameters: [{
|
|
40
|
-
name: "
|
|
40
|
+
name: "commands",
|
|
41
41
|
type: "string[]",
|
|
42
42
|
default: "[]"
|
|
43
43
|
}]
|
|
@@ -51,10 +51,10 @@ function TemporaryHelpCommand() {
|
|
|
51
51
|
*/
|
|
52
52
|
function HelpCommand(props) {
|
|
53
53
|
const context = usePowerlines();
|
|
54
|
-
const helpImports = computed(() => props.commands ? props.commands.reduce((ret,
|
|
55
|
-
ret[joinPaths("help", ...
|
|
54
|
+
const helpImports = computed(() => props.commands ? props.commands.reduce((ret, commands) => {
|
|
55
|
+
ret[joinPaths("help", ...commands)] = [{
|
|
56
56
|
name: "showHelp",
|
|
57
|
-
alias: `showHelp${
|
|
57
|
+
alias: `showHelp${commands.map((command) => pascalCase(command.replace(/-/g, ""))).join("")}`
|
|
58
58
|
}];
|
|
59
59
|
return ret;
|
|
60
60
|
}, {}) : {});
|
|
@@ -90,8 +90,8 @@ function HelpCommand(props) {
|
|
|
90
90
|
heading: "Display command usage details and other useful information to the user.",
|
|
91
91
|
get children() {
|
|
92
92
|
return createComponent(TSDocParam, {
|
|
93
|
-
name: "
|
|
94
|
-
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no
|
|
93
|
+
name: "commands",
|
|
94
|
+
children: `The command segments for the command to show help for. This is used to determine which command's help information to display. If no commands are provided, general help information about the CLI application will be displayed.`
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
}), createComponent(FunctionDeclaration, {
|
|
@@ -100,7 +100,7 @@ function HelpCommand(props) {
|
|
|
100
100
|
async: true,
|
|
101
101
|
name: "handler",
|
|
102
102
|
parameters: [{
|
|
103
|
-
name: "
|
|
103
|
+
name: "commands",
|
|
104
104
|
type: "string[]",
|
|
105
105
|
default: "[]"
|
|
106
106
|
}],
|
|
@@ -114,25 +114,25 @@ function HelpCommand(props) {
|
|
|
114
114
|
return [createComponent(For, {
|
|
115
115
|
each: commandSegmentsList,
|
|
116
116
|
doubleHardline: true,
|
|
117
|
-
children: (
|
|
117
|
+
children: (commands, index) => createComponent(Show, {
|
|
118
118
|
when: index > 0,
|
|
119
119
|
get fallback() {
|
|
120
120
|
return createComponent(IfStatement, {
|
|
121
121
|
get condition() {
|
|
122
|
-
return code`
|
|
122
|
+
return code`commands.join("/").toLowerCase() === "${commands.join("/").toLowerCase()}"`;
|
|
123
123
|
},
|
|
124
124
|
get children() {
|
|
125
|
-
return code` showHelp${
|
|
125
|
+
return code` showHelp${commands.map((command) => pascalCase(command)).join("")}(); `;
|
|
126
126
|
}
|
|
127
127
|
});
|
|
128
128
|
},
|
|
129
129
|
get children() {
|
|
130
130
|
return createComponent(ElseIfClause, {
|
|
131
131
|
get condition() {
|
|
132
|
-
return code`
|
|
132
|
+
return code`commands.join("/").toLowerCase() === "${commands.join("/").toLowerCase()}"`;
|
|
133
133
|
},
|
|
134
134
|
get children() {
|
|
135
|
-
return code` showHelp${
|
|
135
|
+
return code` showHelp${commands.map((command) => pascalCase(command)).join("")}(); `;
|
|
136
136
|
}
|
|
137
137
|
});
|
|
138
138
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shell-shock/plugin-help",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.36",
|
|
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": [
|
|
@@ -156,9 +156,9 @@
|
|
|
156
156
|
"@powerlines/deepkit": "^0.9.81",
|
|
157
157
|
"@powerlines/plugin-alloy": "^0.26.220",
|
|
158
158
|
"@powerlines/plugin-plugin": "^0.12.539",
|
|
159
|
-
"@shell-shock/core": "0.17.
|
|
160
|
-
"@shell-shock/plugin-console": "0.2.
|
|
161
|
-
"@shell-shock/plugin-theme": "0.4.
|
|
159
|
+
"@shell-shock/core": "0.17.18",
|
|
160
|
+
"@shell-shock/plugin-console": "0.2.22",
|
|
161
|
+
"@shell-shock/plugin-theme": "0.4.31",
|
|
162
162
|
"@stryke/helpers": "^0.10.24",
|
|
163
163
|
"@stryke/path": "^0.29.11",
|
|
164
164
|
"@stryke/string-format": "^0.17.26",
|
|
@@ -172,5 +172,5 @@
|
|
|
172
172
|
"@types/node": "^25.9.2"
|
|
173
173
|
},
|
|
174
174
|
"publishConfig": { "access": "public" },
|
|
175
|
-
"gitHead": "
|
|
175
|
+
"gitHead": "4ca0ac0ff9ada03aea6667c89a04b54dc73ff40b"
|
|
176
176
|
}
|