2019-10-25 01:08:09 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
|
|
|
|
|
|
|
use starship_module_config_derive::ModuleConfig;
|
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
|
|
pub struct StarshipRootConfig<'a> {
|
2020-07-07 22:45:32 +00:00
|
|
|
pub format: &'a str,
|
2019-10-28 13:41:16 +00:00
|
|
|
pub scan_timeout: u64,
|
2019-10-25 01:08:09 +00:00
|
|
|
}
|
|
|
|
|
2020-07-07 22:45:32 +00:00
|
|
|
// 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.
|
|
|
|
pub const PROMPT_ORDER: [&str; 42] = [
|
|
|
|
"username",
|
|
|
|
"hostname",
|
|
|
|
"singularity",
|
|
|
|
"kubernetes",
|
|
|
|
"directory",
|
|
|
|
"git_branch",
|
|
|
|
"git_commit",
|
|
|
|
"git_state",
|
|
|
|
"git_status",
|
|
|
|
"hg_branch",
|
|
|
|
"docker_context",
|
|
|
|
"package",
|
|
|
|
// ↓ Toolchain version modules ↓
|
|
|
|
// (Let's keep these sorted alphabetically)
|
|
|
|
"dotnet",
|
|
|
|
"elixir",
|
|
|
|
"elm",
|
|
|
|
"erlang",
|
|
|
|
"golang",
|
|
|
|
"java",
|
|
|
|
"julia",
|
|
|
|
"nim",
|
|
|
|
"nodejs",
|
|
|
|
"ocaml",
|
|
|
|
"php",
|
|
|
|
"purescript",
|
|
|
|
"python",
|
|
|
|
"ruby",
|
|
|
|
"rust",
|
|
|
|
"terraform",
|
|
|
|
"zig",
|
|
|
|
// ↑ Toolchain version modules ↑
|
|
|
|
"nix_shell",
|
|
|
|
"conda",
|
|
|
|
"memory_usage",
|
|
|
|
"aws",
|
|
|
|
"env_var",
|
|
|
|
"crystal",
|
|
|
|
"cmd_duration",
|
|
|
|
"custom",
|
|
|
|
"line_break",
|
|
|
|
"jobs",
|
|
|
|
#[cfg(feature = "battery")]
|
|
|
|
"battery",
|
|
|
|
"time",
|
|
|
|
"character",
|
|
|
|
];
|
|
|
|
|
2019-10-25 01:08:09 +00:00
|
|
|
impl<'a> RootModuleConfig<'a> for StarshipRootConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
StarshipRootConfig {
|
2020-07-07 22:45:32 +00:00
|
|
|
format: "\n$all",
|
2019-10-28 13:41:16 +00:00
|
|
|
scan_timeout: 30,
|
2019-10-25 01:08:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|