Repository navigation
fix(cli): Show group help for sentry <group> help in every group - #2464
Open
sentry-junior[bot] wants to merge 3 commits into
Open
sentry-junior[bot] wants to merge 3 commits into
sentry-junior[bot] wants to merge 3 commits into
Conversation
`sentry auth help`, `status help`, `local help`, `local daemon help`, and `local session help` failed with `Too many arguments, expected 0 but encountered "help"`. Stricli hands a trailing `help` to the group's default command, and those defaults take no positionals, so the argument scanner rejected it before either help recovery ran. Groups with no default recovered, but printed `No command registered for 'help'` first. runCli now rewrites `[global flags] <group...> help` to `help [global flags] <group...>` before dispatch when the path resolves to a route group. A trailing `help` after a leaf command is unchanged: it stays a positional and only becomes help when the command fails. A new test walks every public route group and checks that `<group> help` exits 0, prints the group's help, and shows neither error. Co-Authored-By: Sergiy Dybskiy <3760543+sergical@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
The group help branch returned from runCli inside the try, which skipped the update notification that every successful run shows.
Contributor
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7c05520. Configure here.
The route scanner accepts global flags at any depth, so `sentry auth --json help` must also show group help. groupHelpArgs only skipped flags before the group.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

sentry auth helpfails withToo many arguments, expected 0 but encountered "help". The same happens forstatus,local,local daemon, andlocal session.Stricli passes a trailing
helpto the group's default command. These groups have defaults that take no positionals, so the argument scanner rejectshelpbefore either existing help recovery runs. The error also reads as ifauthtakes no arguments, because it describes the hidden default command and not the group.runClinow rewrites[global flags] <group...> helptohelp [global flags] <group...>before dispatch, whenever the path resolves to a route group. Every group then gets the outputsentry issue helpalready gives: the--helptip on stderr and the group help on stdout, followed by the usual update notification. Groups that have no default command also stop printingNo command registered for 'help'first.Behavior change: after a group,
helpnow always shows help. Before this change, a group whose default takes a positional (for examplesentry project help) first triedhelpas a value, such as a project slug.helpis never a subcommand name, so after a group it always means help. To look up a resource namedhelp, use the explicit subcommand:sentry project view helpstill resolves it.Unchanged: after a leaf command (
sentry issue view help),helpis still a positional and becomes help only when the command fails. A trailinghelpafter an unknown path still prints the unknown-command error with suggestions.Not in this PR: a typo in one of these groups (
sentry auth nope) still gets the misleadingToo many argumentsmessage with no "did you mean". Fixing that belongs in thebuildRouteMapwrapper.via @sergical.
--
View Session [Sentry]