Skip to content

Show -- separator in card creation help and add test coverage#303

Merged
jeremy merged 3 commits intomainfrom
bc-9679149769
Mar 15, 2026
Merged

Show -- separator in card creation help and add test coverage#303
jeremy merged 3 commits intomainfrom
bc-9679149769

Conversation

@jeremy
Copy link
Copy Markdown
Member

@jeremy jeremy commented Mar 15, 2026

Summary

  • Add Example fields to cards create and the card shortcut showing the -- separator for titles that start with dashes (e.g. --Deploy checklist)
  • Add four tests: two for the -- separator path, two regression guards for flags-anywhere behavior

Context

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 test passes
  • bin/ci green
  • basecamp cards create --help and basecamp card --help show the new examples

Summary by cubic

Show the POSIX -- separator in cards create and card help so titles starting with dashes are treated as text, not flags. Place --in before -- 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.

@jeremy jeremy requested a review from a team as a code owner March 15, 2026 21:25
Copilot AI review requested due to automatic review settings March 15, 2026 21:25
@github-actions github-actions bot added commands CLI command implementations tests Tests (unit and e2e) labels Mar 15, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Example strings to basecamp cards create and the basecamp card shortcut showing use of -- for dash-prefixed titles.
  • Add tests for -- separator handling for both cards create and card.
  • 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

jeremy added 3 commits March 15, 2026 14:56
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".
Copilot AI review requested due to automatic review settings March 15, 2026 21:57
@github-actions github-actions bot added the enhancement New feature or request label Mar 15, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Example help text for basecamp cards create demonstrating -- for dash-prefixed titles.
  • Add Example help text for the basecamp card shortcut 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.

@jeremy jeremy merged commit 5613bc9 into main Mar 15, 2026
29 checks passed
@jeremy jeremy deleted the bc-9679149769 branch March 15, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands CLI command implementations enhancement New feature or request tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants