mirror of
https://github.com/Llewellynvdm/starship.git
synced 2024-11-16 10:05:13 +00:00
873a005c42
* feat(erlang): Configure when the module is shown This makes it possible to configure when the erlang module is shown based on the contents of a directory. This should make it possible to be a lot more granular when configuring the module. * Update docs/config/README.md Co-authored-by: Shu Kutsuzawa <cappyzawa@gmail.com> Co-authored-by: Shu Kutsuzawa <cappyzawa@gmail.com>
29 lines
778 B
Rust
29 lines
778 B
Rust
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
pub struct ErlangConfig<'a> {
|
|
pub format: &'a str,
|
|
pub symbol: &'a str,
|
|
pub style: &'a str,
|
|
pub disabled: bool,
|
|
pub detect_extensions: Vec<&'a str>,
|
|
pub detect_files: Vec<&'a str>,
|
|
pub detect_folders: Vec<&'a str>,
|
|
}
|
|
|
|
impl<'a> RootModuleConfig<'a> for ErlangConfig<'a> {
|
|
fn new() -> Self {
|
|
ErlangConfig {
|
|
format: "via [$symbol($version )]($style)",
|
|
symbol: " ",
|
|
style: "bold red",
|
|
disabled: false,
|
|
detect_extensions: vec![],
|
|
detect_files: vec!["rebar.config", "erlang.mk"],
|
|
detect_folders: vec![],
|
|
}
|
|
}
|
|
}
|