1use nvim_oxi::Dictionary;
6
7mod fd;
8mod rg;
9
10pub const GLOB_BLACKLIST: [&str; 7] = [
12 "**/.git/*",
13 "**/target/*",
14 "**/target-*/*",
15 "**/_build/*",
16 "**/deps/*",
17 "**/.elixir_ls/*",
18 "**/node_modules/*",
19];
20
21pub fn dict() -> Dictionary {
23 dict! {
24 "get_fd_flags": fn_from!(fd::FdCliFlags::get),
25 "get_rg_flags": fn_from!(rg::RgCliFlags::get),
26 }
27}
28
29pub trait CliFlags {
31 fn base_flags() -> Vec<&'static str>;
33
34 fn glob_flag(glob: &str) -> String;
36
37 fn get((): ()) -> Vec<String> {
39 Self::base_flags()
40 .into_iter()
41 .map(Into::into)
42 .chain(GLOB_BLACKLIST.into_iter().map(Self::glob_flag))
43 .collect::<Vec<_>>()
44 }
45}