Skip to content

chore: provide instructions for handling CLI argument failures #12355

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

Emyrk
Copy link
Member

@Emyrk Emyrk commented Feb 28, 2024

What this does

When you do not provide enough args, you get an error telling you how many you need. It does not tell you what the arguments should be, so the user needs to run coder <cmd> --help to see.

Now we always print the FullUsage() when the number of arguments is incorrect for a cli command.

Before

$ coder exp example-error arg-required
Encountered an error running "coder exp example-error arg-required"
wanted 1 args but got 0 []

After

$ coder exp example-error arg-required
Encountered an error running "coder exp example-error arg-required"
Usage: coder exp example-error arg-required <required>
Error: wanted 1 args but got 0 []

@Emyrk Emyrk changed the title chore: provide usage instruction for CLI argument failures chore: provide instructions for handling CLI argument failures Feb 28, 2024
@Emyrk Emyrk marked this pull request as ready for review February 28, 2024 18:09
@Emyrk
Copy link
Member Author

Emyrk commented Feb 28, 2024

Merged here #12309

@Emyrk Emyrk closed this Feb 28, 2024
@github-actions github-actions bot deleted the stevenmasley/cli_errors2 branch August 29, 2024 00:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant