use super::super::{
cli_opt::DetailLevel::{self, *},
cross_platform_path,
term::color::*,
};
use std::path::Path;
pub type Act<'a> = Box<dyn Fn(&Path) + 'a>;
pub fn get(details: DetailLevel, hide_passed: bool, theme: &'_ dyn ColorScheme) -> Act<'_> {
let print_name = move |path: &Path| {
let message = format!("🗸 {}", cross_platform_path::to_string(path, '/'));
println!("{}", theme.same().paint(message));
};
match (details, hide_passed) {
(Count, _) | (_, true) => Box::new(|_| ()),
(Name, false) | (Diff, false) => Box::new(print_name),
}
}