refactor(pass): extract multi-line Long descriptions to embedded mark down#533
Conversation
…down Matches the existing pattern used for examples (`*_example.md`, `examples.md`). Touches the three commands whose Long was a multi-line concatenated string: root, `run`, and `set`. Single-line Long fields on `get`/`ls`/`rm` are left inline.
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
Clean mechanical refactor extracting multi-line Long descriptions into embedded .md files, matching the existing *_example.md pattern. All //go:embed paths are correct, embedded content is semantically equivalent to the removed inline strings, and imports are in order. Two minor style notes left as inline comments.
| "started and exits non-zero.", | ||
| Use: "run -- CMD [ARGS...]", | ||
| Short: "Run a command with `se://` environment references resolved.", | ||
| Long: strings.Trim(runLong, "\n"), |
There was a problem hiding this comment.
LOW: Inconsistent whitespace trimming — only newlines stripped, \r and spaces would survive
strings.Trim(runLong, "\n") strips only newline characters from both ends of the embedded string, while command.go uses strings.TrimSpace(rootLong) which also removes carriage-returns, spaces, and tabs.
If run_long.md ever gains a trailing \r (e.g. committed from a Windows editor before git normalises line endings), it will appear verbatim in the Cobra Long help output. Consider using strings.TrimSpace here to match the root command and be robust to accidental whitespace.
| "Pass `--force` to overwrite an existing secret. On Linux and Windows the\n" + | ||
| "replacement is performed atomically. On macOS the Keychain API requires\n" + | ||
| "a delete-then-add sequence.", | ||
| Long: strings.Trim(setLong, "\n"), |
There was a problem hiding this comment.
LOW: Inconsistent whitespace trimming — only newlines stripped, \r and spaces would survive
strings.Trim(setLong, "\n") strips only newline characters from both ends of the embedded string, while command.go uses strings.TrimSpace(rootLong).
Same concern as run.go: a trailing carriage-return or a stray space/tab in set_long.md would survive this trim and appear in the Cobra Long help output. Using strings.TrimSpace consistently across all three call sites would eliminate this fragility.
Matches the existing pattern used for examples (
*_example.md,examples.md). Touches the three commands whose Long was a multi-line concatenated string: root,run, andset. Single-line Long fields onget/ls/rmare left inline.