fix(cli): remove FLAGS section from root --help#1226
Conversation
Follow-up to #1223. The hand-written FLAGS block in `lark-cli --help` restated leaf-command flags at the root level — flags that are not registered on the root command (they error "unknown flag" there). Even trimmed to an illustrative example list, it duplicated information Cobra's per-command `--help` already renders authoritatively, and any static list in root help drifts from the real per-command flag sets over time. Drop the section entirely: Cobra's per-command `Flags:` output is the single source of truth. `USAGE:`/`EXAMPLES:` still show flags in context, and the `Flags:` block at the bottom of root help lists the actual root flags. Also removes the now-obsolete TestRootLong_FlagsSectionPointsToCommandHelp. Change-Id: Ie7f2acd3592c23606e452965b52fba34c113ad91
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughRemoved a generic "FLAGS: …" line from the root command's help text in ChangesHelp text cleanup
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🚀 PR Preview Install Guide🧰 CLI updatenpm i -g https://pkg.pr.new/larksuite/cli/@larksuite/cli@7507581802e339be3ae5437c2771fdf034b10c69🧩 Skill updatenpx skills add larksuite/cli#fix/root-help-drop-flags-section -y -g |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1226 +/- ##
=======================================
Coverage 69.19% 69.19%
=======================================
Files 634 634
Lines 59482 59482
=======================================
Hits 41161 41161
Misses 15007 15007
Partials 3314 3314 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Follow-up to larksuite#1223. The hand-written FLAGS block in `lark-cli --help` restated leaf-command flags at the root level — flags that are not registered on the root command (they error "unknown flag" there). Even trimmed to an illustrative example list, it duplicated information Cobra's per-command `--help` already renders authoritatively, and any static list in root help drifts from the real per-command flag sets over time. Drop the section entirely: Cobra's per-command `Flags:` output is the single source of truth. `USAGE:`/`EXAMPLES:` still show flags in context, and the `Flags:` block at the bottom of root help lists the actual root flags. Also removes the now-obsolete TestRootLong_FlagsSectionPointsToCommandHelp.
Follow-up to #1223.
Why
The
FLAGS:block inlark-cli --helpis hand-written text that restates flags belonging to leaf commands (api,service). Those flags are not registered on the root command and errorunknown flagthere:#1223 trimmed it to a short illustrative example list, but even that duplicates what Cobra's per-command
--helpalready renders authoritatively, and any static flag list maintained by hand in root help drifts from the real per-command sets over time.Change
Remove the
FLAGS:section entirely. Cobra's per-commandFlags:output is the single source of truth:USAGE:/EXAMPLES:still show these flags in their correct position, after a<command>(e.g.lark-cli calendar events instance_view --params '...').Flags:block at the bottom oflark-cli --helpstill lists the actual root flags (-h/--help,--profile,-v/--version).TestRootLong_FlagsSectionPointsToCommandHelp, which asserted on the deleted text.Verification
lark-cli --helpnow flowsEXAMPLES → AI AGENT SKILLS.go test ./cmd/ -run TestRootpasses;go vet ./cmd/clean.Summary by CodeRabbit
Release Notes