Skip to content

Feature/dotenv#86

Merged
godronus merged 2 commits intomainfrom
feature/dotenv
Jun 5, 2025
Merged

Feature/dotenv#86
godronus merged 2 commits intomainfrom
feature/dotenv

Conversation

@godronus
Copy link
Copy Markdown
Contributor

@godronus godronus commented Jun 5, 2025

No description provided.

godronus added 2 commits June 4, 2025 13:46
dotenv merging initial attempt
res_ headers | req_ headers for dotenv file injection included
cleaned up comments and formatting for PR
@godronus godronus requested review from Copilot and ruslanti June 5, 2025 11:26
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 and DotEnvInjector to merge .env entries into env, request headers, response headers, and secrets.
  • Adds new CLI args: dotenv (optional path) and rsp_headers.
  • Registers tempfile as 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. --dotenv without value), it defaults to loading .env from the current directory.
/// Dotenv file path

src/main.rs:70

  • [nitpick] Consider using Option<PathBuf> with default_missing_value = ".env" instead of Option<Option<PathBuf>> for simpler parsing and a clearer API.
#[arg(long, num_args = 0..=1)]

src/main.rs:74

  • [nitpick] The abbreviation rsp_headers may be unclear; consider renaming to response_headers (and EnvArgType::ResponseHeader) for consistency and readability.
rsp_headers: Option<Vec<(SmolStr, SmolStr)>>,

Cargo.toml:49

  • You've added tempfile as 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"

@godronus godronus merged commit c3f374d into main Jun 5, 2025
1 check passed
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.

3 participants