Show -- separator in card creation help and add test coverage#303
Show -- separator in card creation help and add test coverage#303
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves CLI discoverability for creating cards whose titles start with dashes by surfacing the POSIX -- argument separator in help output, and adds tests intended to guard parsing behavior around -- and “flags anywhere” support.
Changes:
- Add
Examplestrings tobasecamp cards createand thebasecamp cardshortcut showing use of--for dash-prefixed titles. - Add tests for
--separator handling for bothcards createandcard. - Add regression tests intended to ensure flags are still parsed when placed after the positional title.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| internal/commands/cards.go | Adds help examples documenting -- separator usage for dash-prefixed titles. |
| internal/commands/cards_test.go | Adds tests covering -- separator parsing and attempted regression coverage for flags-after-title parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2e66dc3a34
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When a card title starts with `--`, Cobra's argument parser treats it as a flag. The standard POSIX `--` separator works but isn't discoverable. Add Example fields to both `cards create` and the `card` shortcut so `basecamp cards create --help` shows the pattern.
Cover the `--` separator path for card titles that start with dashes, and add regression guards ensuring flags after the positional title continue to parse correctly under the flags-anywhere policy.
Move --in flag before the -- separator in help examples so Cobra parses it correctly. Strengthen all four tests: clear ProjectID so --in must be parsed for the command to proceed, require a non-nil error (no-network transport), and assert the error is not a flag parse failure or "Project ID required".
There was a problem hiding this comment.
Pull request overview
This PR improves CLI discoverability for creating cards with titles that begin with dashes by showing the POSIX -- end-of-flags separator in help output, and adds regression tests to ensure argument parsing continues to behave correctly.
Changes:
- Add
Examplehelp text forbasecamp cards createdemonstrating--for dash-prefixed titles. - Add
Examplehelp text for thebasecamp cardshortcut demonstrating the same pattern. - Add four tests covering
--separator handling and “flags-after-title” (interspersed flags) behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| internal/commands/cards.go | Adds Example strings to cards create and card help output to document -- usage for dash-prefixed titles. |
| internal/commands/cards_test.go | Adds parsing-focused tests for dash-prefixed titles using --, plus regression tests for interspersed flags after the title. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Examplefields tocards createand thecardshortcut showing the--separator for titles that start with dashes (e.g.--Deploy checklist)--separator path, two regression guards for flags-anywhere behaviorContext
When a card title starts with
--, Cobra interprets it as a flag. The POSIX--separator already works but wasn't discoverable from help output.Test plan
make testpassesbin/cigreenbasecamp cards create --helpandbasecamp card --helpshow the new examplesSummary by cubic
Show the POSIX
--separator incards createandcardhelp so titles starting with dashes are treated as text, not flags. Place--inbefore--in examples, and add four tests covering dash-prefixed titles and flags-after-title parsing.Written for commit 2f17351. Summary will update on new commits.