From 05210b9510b797f7738d5b2d51e8a6877f2d5283 Mon Sep 17 00:00:00 2001 From: Matan Kushner Date: Fri, 4 Oct 2019 22:30:46 +0900 Subject: refactor: Go from Rust workspaces to a package with nested packages (#480) --- src/configs/mod.rs | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 src/configs/mod.rs (limited to 'src/configs/mod.rs') diff --git a/src/configs/mod.rs b/src/configs/mod.rs new file mode 100644 index 000000000..f557345e4 --- /dev/null +++ b/src/configs/mod.rs @@ -0,0 +1,57 @@ +pub mod aws; +pub mod battery; +pub mod character; +pub mod dotnet; +pub mod rust; + +use crate::config::{ModuleConfig, RootModuleConfig}; + +use starship_module_config_derive::ModuleConfig; + +#[derive(Clone, ModuleConfig)] +pub struct StarshipRootConfig<'a> { + pub add_newline: bool, + pub prompt_order: Vec<&'a str>, +} + +impl<'a> RootModuleConfig<'a> for StarshipRootConfig<'a> { + fn new() -> Self { + StarshipRootConfig { + add_newline: true, + // List of default prompt order + // NOTE: If this const value is changed then Default prompt order subheading inside + // prompt heading of config docs needs to be updated according to changes made here. + prompt_order: vec![ + "username", + "hostname", + "kubernetes", + "directory", + "git_branch", + "git_state", + "git_status", + "package", + // ↓ Toolchain version modules ↓ + // (Let's keep these sorted alphabetically) + "dotnet", + "golang", + "java", + "nodejs", + "python", + "ruby", + "rust", + // ↑ Toolchain version modules ↑ + "nix_shell", + "memory_usage", + "aws", + "env_var", + "cmd_duration", + "line_break", + "jobs", + #[cfg(feature = "battery")] + "battery", + "time", + "character", + ], + } + } +} -- cgit v1.2.3