Skip to content

Commit 49d1c26

Browse files
AshGodfreyclaude
andauthored
fix(quickstart): hide unity from --target help text (#2085)
## Problem PRs keep getting opened against the marketing site re-adding `unity` to the `speakeasy quickstart` `--target` docs (e.g. [marketing-site#1720](speakeasy-api/marketing-site#1720)). The CLI reference docs are regenerated by walking the cobra command tree (`cmd/docs`). The `quickstart --target` help text is built from `prompts.GetSupportedTargetNames()`, which returns the full upstream target list — including `unity`. So every regen re-adds `unity` to `quickstart.md`. ## Fix Filter `unity` out of `prompts.GetSupportedTargetNames()`, which is **display-only** — it's used in exactly one place, the `quickstart --target` help string. Generation and validation are unaffected: those paths call `generate.GetSupportedTargetNames()` directly, so `speakeasy quickstart --target unity` still works. The filter uses a `hiddenTargetNames` map so future deprecated-but-supported targets can be hidden the same way. ## Verification Ran the real `cmd/docs` generator; the regenerated `quickstart.md` line now matches the desired (unity-free) output byte-for-byte: ``` -t, --target string generation target (available options: [cli, csharp, go, java, mcp-typescript, php, postman, python, ruby, terraform, typescript]) ``` `quickstart.md` is the only published doc affected — `run.md`'s `--target` is a target-ID field, and `generate sdk` isn't in the published CLI reference. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Hide `unity` from the `speakeasy quickstart --target` help text so it no longer shows up in published docs. Display-only change: `prompts.GetSupportedTargetNames()` filters `unity` via a `hiddenTargetNames` map; generation/validation still use `generate.GetSupportedTargetNames()`, so `--target unity` still works. <sup>Written for commit cede30c. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/speakeasy-api/speakeasy/pull/2085?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. --> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 0f6be0f commit 49d1c26

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

prompts/utils.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,22 @@ func targetOption(target, maturity string) huh.Option[string] {
8888
return huh.NewOption(fmt.Sprintf("%s %s", getTargetDisplay(target), getMaturityDisplay(maturity)), target)
8989
}
9090

91+
// hiddenTargetNames are valid generation targets that are intentionally
92+
// omitted from user-facing target listings (e.g. the quickstart --target help
93+
// text, which is published to the docs site). They remain fully supported for
94+
// generation and validation via generate.GetSupportedTargetNames().
95+
var hiddenTargetNames = map[string]bool{
96+
"unity": true,
97+
}
98+
9199
func GetSupportedTargetNames() []string {
92-
targetNames := generate.GetSupportedTargetNames()
100+
var targetNames []string
101+
for _, name := range generate.GetSupportedTargetNames() {
102+
if hiddenTargetNames[name] {
103+
continue
104+
}
105+
targetNames = append(targetNames, name)
106+
}
93107

94108
slices.Sort(targetNames)
95109

0 commit comments

Comments
 (0)