Skip to content

Commit

Permalink
Pass trailing arguments to pip in remove command (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnpryer authored Mar 29, 2023
1 parent 6bf9ebc commit 0dca296
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/bin/huak/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ pub enum Commands {
/// Remove from optional dependency group
#[arg(long, num_args = 1)]
group: Option<String>,
/// Pass trailing arguments with `--`.
#[arg(last = true)]
trailing: Option<Vec<String>>,
},
/// Run a command within the project's environment context.
Run {
Expand Down Expand Up @@ -270,7 +273,12 @@ impl Cli {
Commands::Remove {
dependencies,
group,
} => remove(dependencies, group, operation_config),
trailing,
} => {
operation_config.installer_options =
Some(InstallerOptions { args: trailing });
remove(dependencies, group, operation_config)
}
Commands::Run { command } => run(command, operation_config),
Commands::Test { trailing } => {
operation_config.test_options =
Expand Down
4 changes: 2 additions & 2 deletions src/huak/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ pub fn remove_project_dependencies(
.iter()
.map(|item| item.as_str())
.collect::<Vec<&str>>(),
None,
config.installer_options.as_ref(),
&mut terminal,
)?;
project.pyproject_toml().write_file(&manifest_path)
Expand Down Expand Up @@ -495,7 +495,7 @@ pub fn remove_project_optional_dependencies(
.iter()
.map(|item| item.as_str())
.collect::<Vec<&str>>(),
None,
config.installer_options.as_ref(),
&mut terminal,
)?;
project.pyproject_toml().write_file(manifest_path(config))
Expand Down

0 comments on commit 0dca296

Please sign in to comment.