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