Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for --config flag #105

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading