diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d33aba..147f11c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## [3.5.1] - 2024-11-14 + +### Changed +Removed `--target (-t)` flag from `monorail analyze` + ## [3.5.0] - 2024-11-13 ### Changed diff --git a/Cargo.toml b/Cargo.toml index 3e2bfe2..ce99a95 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ description = "A tool for effective polyglot, multi-project monorepo development license = "MIT" homepage = "https://github.com/pnordahl/monorail" repository = "https://github.com/pnordahl/monorail" -version = "3.5.0" +version = "3.5.1" authors = ["Patrick Nordahl "] edition = "2021" keywords = ["monorail", "monorepo", "build", "cli", "build-tool"] diff --git a/src/api/cli.rs b/src/api/cli.rs index 890e2e6..17dde92 100644 --- a/src/api/cli.rs +++ b/src/api/cli.rs @@ -405,16 +405,7 @@ See `monorail run -h` for information on how this interacts with other arg-relat .long(ARG_ALL) .help("Display changes, change targets, and targets") .action(ArgAction::SetTrue), - ) - .arg( - Arg::new(ARG_TARGETS) - .short('t') - .long(ARG_TARGETS) - .required(false) - .num_args(1..) - .value_delimiter(' ') - .action(ArgAction::Append) - .help("Scope analysis to only the provided targets."))) + )) .subcommand( Command::new(CMD_OUT) .about("Manipulate data in the monorail output directory") @@ -792,11 +783,6 @@ impl<'a> From<&'a clap::ArgMatches> for app::analyze::HandleAnalyzeInput<'a> { end: cmd.get_one::(ARG_END).map(|x: &String| x.as_str()), git_path: cmd.get_one::(ARG_GIT_PATH).unwrap(), }, - targets: cmd - .get_many::(ARG_TARGETS) - .into_iter() - .flatten() - .collect(), analyze_input: app::analyze::AnalyzeInput { show_changes: cmd.get_flag(ARG_CHANGES), show_change_targets: cmd.get_flag(ARG_CHANGE_TARGETS), diff --git a/src/app/analyze.rs b/src/app/analyze.rs index 4f1b62e..45f54ed 100644 --- a/src/app/analyze.rs +++ b/src/app/analyze.rs @@ -13,7 +13,6 @@ use crate::core::{git, tracking}; pub(crate) struct HandleAnalyzeInput<'a> { pub(crate) git_opts: git::GitOptions<'a>, pub(crate) analyze_input: AnalyzeInput, - pub(crate) targets: HashSet<&'a String>, } #[derive(Debug)] @@ -87,30 +86,22 @@ pub(crate) async fn handle_analyze<'a>( input: &HandleAnalyzeInput<'a>, work_path: &'a path::Path, ) -> Result { - let (mut index, changes) = match input.targets.len() { - 0 => { - let changes = match cfg.change_provider.r#use { - ChangeProviderKind::Git => match cfg.change_provider.r#use { - ChangeProviderKind::Git => { - let tracking = tracking::Table::new(&cfg.get_tracking_path(work_path))?; - let checkpoint = match tracking.open_checkpoint() { - Ok(checkpoint) => Some(checkpoint), - Err(MonorailError::TrackingCheckpointNotFound(_)) => None, - Err(e) => { - return Err(e); - } - }; - git::get_git_all_changes(&input.git_opts, &checkpoint, work_path).await? + let changes = match cfg.change_provider.r#use { + ChangeProviderKind::Git => match cfg.change_provider.r#use { + ChangeProviderKind::Git => { + let tracking = tracking::Table::new(&cfg.get_tracking_path(work_path))?; + let checkpoint = match tracking.open_checkpoint() { + Ok(checkpoint) => Some(checkpoint), + Err(MonorailError::TrackingCheckpointNotFound(_)) => None, + Err(e) => { + return Err(e); } - }, - }; - ( - core::Index::new(cfg, &cfg.get_target_path_set(), work_path)?, - changes, - ) - } - _ => (core::Index::new(cfg, &input.targets, work_path)?, None), + }; + git::get_git_all_changes(&input.git_opts, &checkpoint, work_path).await? + } + }, }; + let mut index = core::Index::new(cfg, &cfg.get_target_path_set(), work_path)?; analyze(&input.analyze_input, &mut index, changes) }