Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
Add support for --config flag
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonydandrea authored Apr 10, 2024
1 parent b0e3e41 commit d91b28e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ OPTIONS:
--all-features Activate all available features
--no-default-features Do not activate the `default` feature
--profile <PROFILE> Build with the given profile.
--config <CONFIG> Build with the given cargo config
--target <TARGET> Build for the target triple
--target-dir <DIRECTORY> Directory for all generated artifacts
--frozen Require Cargo.lock and cache are up to date
Expand Down Expand Up @@ -329,6 +330,7 @@ pub struct Args {
all_features: bool,
no_default_features: bool,
profile: Option<String>,
config: Option<String>,
target: Option<String>,
target_dir: Option<String>,
frozen: bool,
Expand Down Expand Up @@ -364,6 +366,7 @@ fn parse_args(raw_args: Vec<std::ffi::OsString>) -> Result<Args, pico_args::Erro
all_features: input.contains("--all-features"),
no_default_features: input.contains("--no-default-features"),
profile: input.opt_value_from_str("--profile")?,
config: input.opt_value_from_str("--config")?,
target: input.opt_value_from_str("--target")?,
target_dir: input.opt_value_from_str("--target-dir")?,
frozen: input.contains("--frozen"),
Expand Down Expand Up @@ -782,6 +785,9 @@ fn get_cargo_args(args: &Args, json_output: bool) -> Vec<String> {
list.push(format!("--profile={}", profile));
}

if let Some(ref config) = args.config {
list.push(format!("--config={}", config));
}

if let Some(ref target) = args.target {
list.push(format!("--target={}", target));
Expand Down

0 comments on commit d91b28e

Please sign in to comment.