diff options
| author | Fuwn <[email protected]> | 2021-05-10 16:11:52 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-10 16:11:52 +0000 |
| commit | d528858f1186240b73d51615ca597d9dc2b9d601 (patch) | |
| tree | 2486a49591eeb72a9528b9e43e2fcd4087ac4d90 /src/config/mod.rs | |
| parent | perf(api): use actix_web instead of rocket for api (diff) | |
| download | whirl-d528858f1186240b73d51615ca597d9dc2b9d601.tar.xz whirl-d528858f1186240b73d51615ca597d9dc2b9d601.zip | |
feat(prompt): toggle prompt via configuration file
Adds the ability to enable or disable the Whirl Shell from a `Whirl.toml` file.
BREAKING CHANGE: `whirsplash.prompt.enable` configuration key created.
closes #19
Diffstat (limited to 'src/config/mod.rs')
| -rw-r--r-- | src/config/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/config/mod.rs b/src/config/mod.rs index 6b50086..a71020d 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -10,12 +10,17 @@ pub struct WhirlsplashConfig { pub ip: String, pub prompt_ps1: String, pub api: WhirlsplashApiConfig, + pub prompt: WhirlsplashPromptConfig, } #[derive(Serialize, Deserialize, Debug)] pub struct WhirlsplashApiConfig { pub port: i64, } #[derive(Serialize, Deserialize, Debug)] +pub struct WhirlsplashPromptConfig { + pub enable: bool, +} +#[derive(Serialize, Deserialize, Debug)] pub struct DistributorConfig { pub worldsmaster_greeting: String, pub port: i64, @@ -62,6 +67,9 @@ impl Default for Config { api: WhirlsplashApiConfig { port: 80 }, + prompt: WhirlsplashPromptConfig { + enable: false + }, }, distributor: DistributorConfig { worldsmaster_greeting: "Welcome to Whirlsplash!".to_string(), |