Skip to content

fix(explain): show help when positional arg passed without qualifier flag#127

Merged
khaong merged 2 commits intomainfrom
alex/explain-help-for-positional-args
Jan 30, 2026
Merged

fix(explain): show help when positional arg passed without qualifier flag#127
khaong merged 2 commits intomainfrom
alex/explain-help-for-positional-args

Conversation

@khaong
Copy link
Contributor

@khaong khaong commented Jan 29, 2026

Summary

  • Shows help text when user passes a positional argument without --checkpoint, --session, or --commit flag
  • Adds a hint message guiding users to the correct flag usage
  • Previously entire explain abc123 would silently do nothing

Test plan

  • Unit test added for the new behavior
  • All existing explain tests pass
  • Manual testing: entire explain abc123 now shows hint + help

🤖 Generated with Claude Code


Note

Low Risk
Low risk CLI UX change: explain now errors on unexpected positional args and adds a guidance hint; core explain logic and data handling are unchanged.

Overview
entire explain now rejects positional arguments and returns a clearer error that includes a hint to use --checkpoint, --session, or --commit instead of silently doing nothing.

Adds a unit test (TestExplainCmd_RejectsPositionalArgs) covering multiple arg orderings to ensure the new validation and hint remain in place.

Written by Cursor Bugbot for commit 0cc044c. This will update automatically on new commits. Configure here.

…flag

Previously, `entire explain abc123` would silently ignore the positional
argument. Now it shows a hint and help text, guiding users to use
--checkpoint, --session, or --commit flags.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Entire-Checkpoint: 6de70163f7e3
@khaong khaong requested a review from a team as a code owner January 29, 2026 22:30
Copilot AI review requested due to automatic review settings January 29, 2026 22:30
Copy link
Contributor

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

Updates the explain command to show a helpful hint plus the help/usage text when a user provides a positional argument without specifying what kind of entity (--checkpoint, --session, or --commit) they intended to explain.

Changes:

  • Detects positional args passed to entire explain without qualifier flags and prints a hint + help output.
  • Adds a unit test asserting hint-to-stderr and help-to-stdout behavior for the positional-arg case.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cmd/entire/cli/explain.go Adds logic to show a hint and help when positional args are provided without qualifier flags.
cmd/entire/cli/explain_test.go Adds a unit test validating the new hint + help behavior.

Address Copilot review: reject positional arguments with a custom
validator that provides a helpful hint about the correct flags to use.
This handles all cases including `explain abc123 --checkpoint def456`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@khaong khaong enabled auto-merge January 29, 2026 23:52
@khaong khaong merged commit afece74 into main Jan 30, 2026
4 checks passed
@khaong khaong deleted the alex/explain-help-for-positional-args branch January 30, 2026 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants