From 64e6706901d25f94446876884b9c76bd51e3ff36 Mon Sep 17 00:00:00 2001 From: Luca Palmieri <20745048+LukeMathWalker@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:23:29 +0100 Subject: [PATCH] feat: 'pavex' and 'pavexc' check a dedicated environment variable, in addition to invocation flags, to determine if diagnostic information should be outputted --- libs/pavex_cli/src/command.rs | 2 +- libs/pavexc_cli/src/main.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/pavex_cli/src/command.rs b/libs/pavex_cli/src/command.rs index 9220997c3..5168e419f 100644 --- a/libs/pavex_cli/src/command.rs +++ b/libs/pavex_cli/src/command.rs @@ -110,7 +110,7 @@ pub enum Command { /// Optional. /// If provided, Pavex will serialize diagnostic information about /// the application to the specified path. - #[clap(long, value_parser)] + #[clap(long, env = "PAVEX_DIAGNOSTICS", value_parser)] diagnostics: Option, #[clap(long)] /// Verify that the generated server SDK is up-to-date. diff --git a/libs/pavexc_cli/src/main.rs b/libs/pavexc_cli/src/main.rs index 209f8877d..1d0314054 100644 --- a/libs/pavexc_cli/src/main.rs +++ b/libs/pavexc_cli/src/main.rs @@ -113,14 +113,14 @@ enum Commands { blueprint: PathBuf, /// Optional. If provided, pavex will serialize diagnostic information about /// the application to the specified path. - #[clap(long, value_parser)] + #[clap(long, env = "PAVEXC_DIAGNOSTICS", value_parser)] diagnostics: Option, /// The path to the directory that will contain the manifest and the source code for the generated application crate. /// If the provided path is relative, it is interpreted as relative to the root of the current workspace. #[clap(short, long, value_parser)] output: PathBuf, #[clap(long)] - /// Verify that the generated server SDK is up-to-date. + /// Verify that the generated server SDK is up-to-date. /// If it isn't, `pavexc` will return an error without updating /// the server SDK code. check: bool,