From c7a4aae2e7a90e360160881a188b8c5e77eb0c3f Mon Sep 17 00:00:00 2001 From: Anthony D'Andrea Date: Wed, 10 Apr 2024 12:12:03 -0400 Subject: [PATCH 1/2] Add support for --config flag for customizing cargo build --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 6c23055..66e5e1e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -283,6 +283,7 @@ OPTIONS: --all-features Activate all available features --no-default-features Do not activate the `default` feature --profile Build with the given profile. + --config Build with the given cargo config --target Build for the target triple --target-dir Directory for all generated artifacts --frozen Require Cargo.lock and cache are up to date @@ -329,6 +330,7 @@ pub struct Args { all_features: bool, no_default_features: bool, profile: Option, + config: Option, target: Option, target_dir: Option, frozen: bool, @@ -364,6 +366,7 @@ fn parse_args(raw_args: Vec) -> Result Vec { list.push(format!("--profile={}", profile)); } + if let Some(ref config) = args.config { + list.push(format!("--config={}", config.to_string())); + } if let Some(ref target) = args.target { list.push(format!("--target={}", target)); From a7819d0c8905ac88466908ad29d90cbf11610653 Mon Sep 17 00:00:00 2001 From: Anthony D'Andrea Date: Wed, 10 Apr 2024 12:14:49 -0400 Subject: [PATCH 2/2] Remove unneeded .to_string() --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 66e5e1e..7d42835 100644 --- a/src/main.rs +++ b/src/main.rs @@ -786,7 +786,7 @@ fn get_cargo_args(args: &Args, json_output: bool) -> Vec { } if let Some(ref config) = args.config { - list.push(format!("--config={}", config.to_string())); + list.push(format!("--config={}", config)); } if let Some(ref target) = args.target {