Conversation
dotenv merging initial attempt
res_ headers | req_ headers for dotenv file injection included cleaned up comments and formatting for PR
Contributor
There was a problem hiding this comment.
Pull Request Overview
Adds support for loading environment variables, headers, and secrets from a dotenv file and wires it into the CLI.
- Introduces a
--dotenv[=PATH]flag andDotEnvInjectorto merge.enventries into env, request headers, response headers, and secrets. - Adds new CLI args:
dotenv(optional path) andrsp_headers. - Registers
tempfileas a dev-dependency (presumably for future tests).
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main.rs | Add mod dotenv, new CLI args, and use DotEnvInjector to merge |
| Cargo.toml | Add tempfile = "3.20.0" under [dev-dependencies] |
Comments suppressed due to low confidence (4)
src/main.rs:69
- Expand this doc comment to clarify that if no path is provided (e.g.
--dotenvwithout value), it defaults to loading.envfrom the current directory.
/// Dotenv file path
src/main.rs:70
- [nitpick] Consider using
Option<PathBuf>withdefault_missing_value = ".env"instead ofOption<Option<PathBuf>>for simpler parsing and a clearer API.
#[arg(long, num_args = 0..=1)]
src/main.rs:74
- [nitpick] The abbreviation
rsp_headersmay be unclear; consider renaming toresponse_headers(andEnvArgType::ResponseHeader) for consistency and readability.
rsp_headers: Option<Vec<(SmolStr, SmolStr)>>,
Cargo.toml:49
- You've added
tempfileas a dev-dependency but no tests currently use it; consider adding tests for the dotenv logic or removing the unused dependency.
tempfile = "3.20.0"
ruslanti
approved these changes
Jun 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.