-
Notifications
You must be signed in to change notification settings - Fork 68
Add support for environment variables in @Option defaultValue #355
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: stalep <[email protected]>
Co-authored-by: stalep <[email protected]>
stalep
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of changing defaultValues, we should instead analyze the value of the defaultValue. If it matches an environment variable pattern it should replace it with the value found.
|
@copilot can you rewrite the pr based on the previous comment? |
Co-authored-by: stalep <[email protected]>
Rewritten in commit f17a428. The environment variable resolution now happens in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Adds support for resolving environment variables in
@Optiondefault values using$(ENV_VAR_NAME)syntax.Changes
ProcessedOption.java: Resolve environment variables when default values are used (at usage time)
$(ENV_VAR_NAME)is replaced withSystem.getenv("ENV_VAR_NAME")$()is ignoreddefaultValuesare never modified; resolution happens when values are analyzedEnvironmentVariableDefaultValueTest.java: 6 tests covering resolution, missing vars, empty syntax, and annotation-based usage
Usage
When the option is not provided by the user, aesh resolves
$(MY_ENV_VALUE)to the environment variable's value when the default value is being used.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.