Remove PLUGINS section from help message (#2309)

This commit is contained in:
jwhur authored and GitHub committed 2026-09-28 13:14:07 -07:00
1 parent 2e23485f62
commit 6fba624647
2 files changed
+15 -8

No files matched your search

+1 -2
View File
@@ -217,7 +217,7 @@ extension Application {
let original = Application.helpMessage(for: Application.self)
guard let pluginLoader else {
print(addGroupSpacing(original))
print("\nPLUGINS: not available, run `container system start`")
print("\n[Warning] CLI plugins not available, run `container system start`")
return
}
let altered = pluginLoader.alterCLIHelpText(original: original)
@@ -227,7 +227,6 @@ extension Application {
private static func addGroupSpacing(_ text: String) -> String {
text
.replacingOccurrences(of: "\n([A-Z].+SUBCOMMANDS:)", with: "\n\n$1", options: .regularExpression)
.replacingOccurrences(of: "\nPLUGINS:", with: "\n\nPLUGINS:")
}
func isTranslated() throws -> Bool {
+14 -6
View File
@@ -76,15 +76,23 @@ extension PluginLoader {
}
var lines = original.split(separator: "\n").map { String($0) }
let pluginLines = plugins.map { $0.helpText(padding: 24) }
let sectionHeader = "PLUGINS:"
lines.append(sectionHeader)
for plugin in plugins {
let helpText = plugin.helpText(padding: 24)
lines.append(helpText)
// List plugin CLI surfaces alongside the built-in "other" commands
// rather than under their own section, since from the user's
// perspective they're just more subcommands.
guard let otherHeaderIndex = lines.firstIndex(of: "OTHER SUBCOMMANDS:") else {
lines.append("OTHER SUBCOMMANDS:")
lines.append(contentsOf: pluginLines)
return lines.joined(separator: "\n")
}
var insertionIndex = otherHeaderIndex + 1
while insertionIndex < lines.count, lines[insertionIndex].hasPrefix(" ") {
insertionIndex += 1
}
lines.insert(contentsOf: pluginLines, at: insertionIndex)
return lines.joined(separator: "\n")
}