Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(cli): show error/hide help for unsupported subcommands (#10760)#12624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

elasticspoon
Copy link
Contributor

@elasticspoonelasticspoon commentedMar 18, 2024
edited
Loading

Fixes#10760

The coder CLI quietly accepts any subcommand arguments and silently swallows them.

Currently:

❯ coder| head -n5coder v2.3.3+e491217USAGE:  coder [global-flags]<subcommand>
❯ coder idontexist| head -n5coder v2.3.3+e491217USAGE:  coder [global-flags]<subcommand>

Now help output will not be show when there is an unknown subcommand error. Instead users will be given the command for the help output.

❯ coder idontexistEncountered an error running"coder", see"coder --help"for more information error: unrecognized subcommand"idontexist"
❯ coder iexistbut idontexistEncountered an error running"coder iexistbut", see"coder iexistbut --help"for more information error: unrecognized subcommand"idontexist"

Also this stuff:Encountered an error running "coder iexistbut"... gets written toos.Stdout inprettyErrorFormatter{w: os.Stderr, verbose: r.verbose}, not sure how to test that output.

@cdr-botcdr-botbot added the communityPull Requests and issues created by the community. labelMar 18, 2024
@elasticspoonelasticspoonforce-pushed the10760-show-subcommand-errors branch fromef62f90 to6fa4ef3CompareMarch 18, 2024 00:37
…er#10760)The coder CLI quietly accepts any subcommand arguments and silently swallows them.Currently:❯ coder idontexist | head -n5coder v2.3.3+e491217USAGE:  coder [global-flags] <subcommand>Now help output will not be show but users will be giventhe command for the help output.❯ coder idontexistEncountered an error running "coder", see "coder --help" for more informationerror: unrecognized subcommand "idontexist"❯ coder iexistbut idontexistEncountered an error running "coder iexistbut", see "coder iexistbut --help" for more informationunrecognized subcommand "idontexist"
@elasticspoonelasticspoonforce-pushed the10760-show-subcommand-errors branch from6fa4ef3 to446a9c0CompareMarch 18, 2024 01:36
@elasticspoonelasticspoon marked this pull request as ready for reviewMarch 18, 2024 01:37
@kylecarbskylecarbs requested a review fromammarioMarch 18, 2024 01:38
Copy link
Member

@ammarioammario left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nice. Thank you for the contribution.

@ammarioammario merged commit5011edc intocoder:mainMar 18, 2024
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMar 18, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@ammarioammarioammario approved these changes

Assignees

@elasticspoonelasticspoon

Labels
communityPull Requests and issues created by the community.
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Show error instead of help when the user uses an unsupported subcommand on the CLI
2 participants
@elasticspoon@ammario

[8]ページ先頭

©2009-2025 Movatter.jp