feat: use vector for --allowlist and --blocklist for passing multiples
This commit is contained in:
parent
8983863ffa
commit
266a00d983
|
@ -41,13 +41,15 @@ pub struct Args {
|
||||||
pub split_to: Option<PathBuf>,
|
pub split_to: Option<PathBuf>,
|
||||||
|
|
||||||
/// An allowlist of files to keep, in .gitignore format.
|
/// An allowlist of files to keep, in .gitignore format.
|
||||||
|
/// Can be passed multiple times.
|
||||||
/// Note: this will take precedence over all other removal decisions.
|
/// Note: this will take precedence over all other removal decisions.
|
||||||
#[arg(long, value_parser = AbsolutePathBufValueParser::default())]
|
#[arg(long, value_parser = AbsolutePathBufValueParser::default())]
|
||||||
pub allowlist: Option<PathBuf>,
|
pub allowlist: Vec<PathBuf>,
|
||||||
|
|
||||||
/// A blocklist of files to remove, in .gitignore format.
|
/// A blocklist of files to remove, in .gitignore format.
|
||||||
|
/// Can be passed multiple times.
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub blocklist: Option<PathBuf>,
|
pub blocklist: Vec<PathBuf>,
|
||||||
|
|
||||||
/// An optional path to save the file graph of the DSO cleaner
|
/// An optional path to save the file graph of the DSO cleaner
|
||||||
/// in GraphViz format. Useful for debugging.
|
/// in GraphViz format. Useful for debugging.
|
||||||
|
|
|
@ -41,11 +41,11 @@ impl Runner {
|
||||||
let removal_fn = Self::new_removal_fn(&args);
|
let removal_fn = Self::new_removal_fn(&args);
|
||||||
let mut cleaners: Cleaners = vec![];
|
let mut cleaners: Cleaners = vec![];
|
||||||
|
|
||||||
if let Some(wl) = args.allowlist {
|
for wl in args.allowlist {
|
||||||
cleaners.push(Box::new(ListCleaner::new(list::ListType::Allow, wl)));
|
cleaners.push(Box::new(ListCleaner::new(list::ListType::Allow, wl)));
|
||||||
}
|
}
|
||||||
|
|
||||||
if let Some(bl) = args.blocklist {
|
for bl in args.blocklist {
|
||||||
cleaners.push(Box::new(ListCleaner::new(list::ListType::Block, bl)));
|
cleaners.push(Box::new(ListCleaner::new(list::ListType::Block, bl)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue