Skip to content
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

Enable customization of exit code for required env var #590

Open
johnstonmatt opened this issue May 15, 2023 · 2 comments
Open

Enable customization of exit code for required env var #590

johnstonmatt opened this issue May 15, 2023 · 2 comments

Comments

@johnstonmatt
Copy link

We @polyseam are happy users of Cliffy!

The .env() method is useful for denoting environment variables as "required" and providing nice error messages, but it always exits with the status code 1 and there is no way to set a more descriptive code so that users can more easily find relevant support material. This is made worse because 1 is also the default exit code by everyone else so it is quite overloaded.

I created a repo to demonstrate the above at johnstonmatt/required-env-demo.

Thanks for all your hard work on cliffy!

@c4spar
Copy link
Owner

c4spar commented May 19, 2023

Hi @johnstonmatt, I'm glad to hear that!

Sounds reasonable to make the exitCode configurable. Should we make a distinction between missing or invalid values?
We could also set the exitCode to 2 by default for invalid usage.

@johnstonmatt
Copy link
Author

I think making both of those changes would be great improvements, and would definitely enable what we are hoping to do.

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

No branches or pull requests

2 participants