fix: update cli help text for checkout command#5
Conversation
|
| Filename | Overview |
|---|---|
| scripts/cli.ts | Help text, header comment, SHORT_CMDS mapping, and error/banner strings updated to surface checkout/ck as the primary command/alias, while the old sw alias is silently dropped from displayed help (though it still works at runtime). |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[User types command] --> B{rawCmd}
B -->|ck| C[SHORT_CMDS lookup → switch]
B -->|checkout| C
B -->|sw| C
B -->|switch| D[Not in SHORT_CMDS → cmd = switch]
C --> E[case switch handler]
D --> E
E --> F{arg1 provided?}
F -->|No| G[die: branch name required]
F -->|Yes| H[banner: checkout target]
H --> I[git checkout target]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[User types command] --> B{rawCmd}
B -->|ck| C[SHORT_CMDS lookup → switch]
B -->|checkout| C
B -->|sw| C
B -->|switch| D[Not in SHORT_CMDS → cmd = switch]
C --> E[case switch handler]
D --> E
E --> F{arg1 provided?}
F -->|No| G[die: branch name required]
F -->|Yes| H[banner: checkout target]
H --> I[git checkout target]
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
scripts/cli.ts:1043
The `sw` alias is silently dropped from the displayed help table. It still resolves at runtime (via `SHORT_CMDS`), so existing users or scripts that call `gg sw <branch>` keep working — but there's no indication in the help output that `sw` is still accepted. Adding it as a secondary note avoids surprising users who are familiar with the old alias.
```suggestion
["checkout <branch>", "ck <branch>", "git checkout <branch> (sw alias still works)"],
```
Reviews (1): Last reviewed commit: "fix: update cli help text for checkout c..." | Re-trigger Greptile
| ["merge <src> [dst] [-m]", "m <src> [dst]", "commit → checkout dst|main → merge → push"], | ||
| ["save [-m]", "s [-m]", "commit current work, then checkout main"], | ||
| ["switch <branch>", "sw <branch>", "checkout <branch>"], | ||
| ["checkout <branch>", "ck <branch>", "git checkout <branch>"], |
There was a problem hiding this comment.
The
sw alias is silently dropped from the displayed help table. It still resolves at runtime (via SHORT_CMDS), so existing users or scripts that call gg sw <branch> keep working — but there's no indication in the help output that sw is still accepted. Adding it as a secondary note avoids surprising users who are familiar with the old alias.
| ["checkout <branch>", "ck <branch>", "git checkout <branch>"], | |
| ["checkout <branch>", "ck <branch>", "git checkout <branch> (sw alias still works)"], |
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/cli.ts
Line: 1043
Comment:
The `sw` alias is silently dropped from the displayed help table. It still resolves at runtime (via `SHORT_CMDS`), so existing users or scripts that call `gg sw <branch>` keep working — but there's no indication in the help output that `sw` is still accepted. Adding it as a secondary note avoids surprising users who are familiar with the old alias.
```suggestion
["checkout <branch>", "ck <branch>", "git checkout <branch> (sw alias still works)"],
```
How can I resolve this? If you propose a fix, please make it concise.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Summary
checkoutcommand to reflect theckaliasswitchcommand tocheckoutin help text and documentationTest plan
checkoutcommand now showsckaliasswitchcommand still works as beforecheckoutcommand to ensureckalias is mentioned