Skip to content

Commit

Permalink
Allow building selected packages with --package
Browse files Browse the repository at this point in the history
Issue #22
  • Loading branch information
davidlattimore committed Aug 3, 2024
1 parent ec52f53 commit b144276
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum OuterCommand {
#[clap(version, about)]
struct Args {
/// Directory containing crate to analyze. Defaults to current working directory.
#[clap(short, long)]
#[clap(long)]
path: Option<PathBuf>,

/// Path to cackle.toml. Defaults to cackle.toml in the directory containing Cargo.toml.
Expand Down Expand Up @@ -163,6 +163,12 @@ struct Args {
#[clap(long)]
no_backtrace: bool,

// We may at some point allow this to be a short flag, but should probably wait a few releases.
// -p was previously accepted for --path.
/// Packages to build and analyse.
#[clap(long)]
package: Vec<String>,

#[command(subcommand)]
command: Option<Command>,
}
Expand Down
3 changes: 3 additions & 0 deletions src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@ impl<'a> CargoRunner<'a> {
self.args,
&self.config.raw.common,
);
for pkg in &self.args.package {
command.arg("-p").arg(pkg);
}
if self.args.command.is_none() {
let default_build_flags = ["--all-targets".to_owned()];
for flag in self
Expand Down

0 comments on commit b144276

Please sign in to comment.