-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
When parsing an argument from a file or env var, the error should mention the source #1167
Comments
If you allow a flag to be set from environment variables or files and a parse error occurs from one of them, it is very useful for the error message to mention where the value came from. Without this, it can be difficult to notice an error caused by an unexpected environment variable being set. Implements urfave#1167.
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Bump. |
This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant. |
If you allow a flag to be set from environment variables or files and a parse error occurs from one of them, it is very useful for the error message to mention where the value came from. Without this, it can be difficult to notice an error caused by an unexpected environment variable being set. Implements urfave#1167.
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Bump. |
This issue or PR has been bumped and is no longer marked as stale! Feel free to bump it again in the future, if it's still relevant. |
Bump. |
This issue or PR has been automatically marked as stale because it has not had recent activity. Please add a comment bumping this if you're still interested in it's resolution! Thanks for your help, please let us know if you need anything else. |
Closing this as it has become stale. |
#1168 was merged (thanks!) - closing this. |
Checklist
What problem does this solve?
I have had a few bug reports from users that run a binary that uses urfave/cli in orchestrated/containerised environments which automatically set some environment variables with default values, and those environment variable names match some of those used by cli in my application. The application exits with a "could not parse ..." error, but the user confused because they did not specify that value anywhere themselves.
Solution description
When a parse error fails, we should state where the value was obtained (since multiple environment variables and files are allowed as the source of a single flag).
Describe alternatives you've considered
We could remove the possibility of allowing multiple sources (environment variables/files) for a given flag, but that would break existing users.
The text was updated successfully, but these errors were encountered: