mirror of
https://github.com/starship/starship.git
synced 2026-06-23 02:05:51 +07:00
feat(shell): add unknown_indicator parameter (#2649)
* Add default config parameter for shell * Update docs for shell default parameter * Change parameter to more obvious name
This commit is contained in:
@@ -13,6 +13,7 @@ pub struct ShellConfig<'a> {
|
||||
pub ion_indicator: &'a str,
|
||||
pub elvish_indicator: &'a str,
|
||||
pub tcsh_indicator: &'a str,
|
||||
pub unknown_indicator: &'a str,
|
||||
pub disabled: bool,
|
||||
}
|
||||
|
||||
@@ -27,6 +28,7 @@ impl<'a> Default for ShellConfig<'a> {
|
||||
ion_indicator: "ion",
|
||||
elvish_indicator: "esh",
|
||||
tcsh_indicator: "tsh",
|
||||
unknown_indicator: "",
|
||||
disabled: true,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
Shell::Ion => Some(config.ion_indicator),
|
||||
Shell::Elvish => Some(config.elvish_indicator),
|
||||
Shell::Tcsh => Some(config.tcsh_indicator),
|
||||
Shell::Unknown => None,
|
||||
Shell::Unknown => Some(config.unknown_indicator),
|
||||
},
|
||||
_ => None,
|
||||
})
|
||||
@@ -36,6 +36,7 @@ pub fn module<'a>(context: &'a Context) -> Option<Module<'a>> {
|
||||
"ion_indicator" => Some(Ok(config.ion_indicator)),
|
||||
"elvish_indicator" => Some(Ok(config.elvish_indicator)),
|
||||
"tcsh_indicator" => Some(Ok(config.tcsh_indicator)),
|
||||
"unknown_indicator" => Some(Ok(config.unknown_indicator)),
|
||||
_ => None,
|
||||
})
|
||||
.parse(None)
|
||||
|
||||
Reference in New Issue
Block a user