fix(gh): passthrough --help/-h on pr subcommands (#1474)#1661
fix(gh): passthrough --help/-h on pr subcommands (#1474)#1661season179 wants to merge 15 commits intortk-ai:developfrom
Conversation
Next Release
…master--components--rtk chore(master): release 0.37.0
fix(docs): user facing docs
…master--components--rtk chore(master): release 0.37.1
Next Release
…master--components--rtk chore(master): release 0.37.2
Next Release
hotfix(cicd): add git app for release please token
hotfix(cicd): github app token for write actions
…master--components--rtk chore(master): release 0.38.0
pr_action and pr_create fabricate ok confirmations regardless of stdout, and view_pr/pr_checks/pr_diff assume specific output formats — all six mangle gh's help text. Add a has_help_flag check at the top of run_pr so --help/-h short-circuits to passthrough.
|
|
📊 Automated PR Analysis
SummaryFixes six of nine Review Checklist
Linked issues: #1474 Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
bumping this pr since issue is very annoying |
Closes #1474.
rtk gh pr comment --helpreturnsok commented,pr edit --helpreturnsok edited, andpr create --helpstitchesok createdonto mangled help text.pr view/checks/diff --helpare also broken — they error withPR number requiredor drop output silently. Six of ninegh prsubcommands corrupt their help output.Cause:
pr_actionandpr_createfabricate confirmations fromok_confirmation()regardless of stdout;view_pr/pr_checksrequire a positional PR number;pr_diffrunscompact_diffover non-diff text. None of them check for--help/-h.Fix: add a
has_help_flaghelper next to the existinghas_json_flag, and short-circuitrun_prto passthrough when the flag is present. Same family as #720 / #730 — flag-aware passthrough at the dispatcher.Verified locally on macOS / rtk 0.38.0:
ok commented/ok editedok created+ mangled helpPR number required-hshort flag also works. Filter path for non-help calls is unaffected (rtk gh pr list -L 3still shows the compact format).Test plan
has_help_flag(long, short, absent, substring resistance,--body=--helpvalue form)cargo fmt --all && cargo clippy --all-targets -- -D unsafe_code && cargo test --all— 1691 + 5 new passgh prsubcommandsrtk gh pr listoutput unchanged