Allow for multiple root-dir args
parent
de2b6190d5
commit
fd7e8c2e88
|
@ -9,7 +9,7 @@ use crate::heatmap::{ColorLogic, Format, HeatmapColors};
|
|||
#[command(version, about, author, long_about = None, args_override_self = true)]
|
||||
pub struct CliArgs {
|
||||
#[arg(long("root-dir"), value_hint = ValueHint::DirPath)]
|
||||
pub root_dir: Option<PathBuf>,
|
||||
pub root_dir: Option<Vec<PathBuf>>,
|
||||
|
||||
#[arg(short, long, num_args(0..))]
|
||||
pub authors: Option<Vec<String>>,
|
||||
|
|
|
@ -196,9 +196,11 @@ fn get_commits(
|
|||
let ignored_repos = args.ignored_repos.as_ref().unwrap_or(&vec![]).to_owned();
|
||||
|
||||
let (repos, branches) = match &args.root_dir {
|
||||
Some(root) => {
|
||||
Some(roots) => {
|
||||
let mut repos: Vec<PathBuf> = vec![];
|
||||
for root in roots {
|
||||
find_git_repos(root, &mut repos, &ignored_repos, &args);
|
||||
}
|
||||
let branches = vec!["".to_string(); repos.len()];
|
||||
(repos, branches)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue