diff options
author | Zhenhui Xie <xiezh0831@126.com> | 2019-09-30 20:10:35 +0800 |
---|---|---|
committer | Matan Kushner <hello@matchai.me> | 2019-09-30 21:10:35 +0900 |
commit | dd0b1a1aa2c36bf2df4db9c11a6517a018ffa100 (patch) | |
tree | e2bb1b1bc6b60cb23848af9c625d21575250ecf0 /src/modules/mod.rs | |
parent | 9e9eb6a8ef87f7b93dc07e0cf068ccb1a6ce588c (diff) |
refactor: Refactoring config (#383)
This PR refactors config and puts configuration files for all modules in `configs/`.
Diffstat (limited to 'src/modules/mod.rs')
-rw-r--r-- | src/modules/mod.rs | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/modules/mod.rs b/src/modules/mod.rs deleted file mode 100644 index f073c5a6c..000000000 --- a/src/modules/mod.rs +++ /dev/null @@ -1,63 +0,0 @@ -// While adding out new module add out module to src/module.rs ALL_MODULES const array also. -mod aws; -mod character; -mod cmd_duration; -mod directory; -mod env_var; -mod git_branch; -mod git_state; -mod git_status; -mod golang; -mod hostname; -mod java; -mod jobs; -mod line_break; -mod memory_usage; -mod nix_shell; -mod nodejs; -mod package; -mod python; -mod ruby; -mod rust; -mod time; -mod username; - -#[cfg(feature = "battery")] -mod battery; - -use crate::context::Context; -use crate::module::Module; - -pub fn handle<'a>(module: &str, context: &'a Context) -> Option<Module<'a>> { - match module { - "aws" => aws::module(context), - "directory" => directory::module(context), - "env_var" => env_var::module(context), - "character" => character::module(context), - "nodejs" => nodejs::module(context), - "rust" => rust::module(context), - "python" => python::module(context), - "ruby" => ruby::module(context), - "golang" => golang::module(context), - "line_break" => line_break::module(context), - "package" => package::module(context), - "git_branch" => git_branch::module(context), - "git_state" => git_state::module(context), - "git_status" => git_status::module(context), - "username" => username::module(context), - #[cfg(feature = "battery")] - "battery" => battery::module(context), - "cmd_duration" => cmd_duration::module(context), - "java" => java::module(context), - "jobs" => jobs::module(context), - "nix_shell" => nix_shell::module(context), - "hostname" => hostname::module(context), - "time" => time::module(context), - "memory_usage" => memory_usage::module(context), - - _ => { - eprintln!("Error: Unknown module {}. Use starship module --list to list out all supported modules.", module); - None - } - } -} |