diff options
| author | Fuwn <[email protected]> | 2021-05-10 16:16:56 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2021-05-10 16:16:56 +0000 |
| commit | ebe2a60e841b9d1108956e2984b8d81613de0f3a (patch) | |
| tree | 8549f4dd558920f8521b60c5d2227d5bf13cf53d /src | |
| parent | feat(prompt): toggle prompt via configuration file (diff) | |
| download | whirl-ebe2a60e841b9d1108956e2984b8d81613de0f3a.tar.xz whirl-ebe2a60e841b9d1108956e2984b8d81613de0f3a.zip | |
refactor(config): move `prompt_ps1` configuration key to `whirlsplash.prompt` group as `ps1`
The `prompt_ps1` configuration key is moved to the `whirlsplash.prompt` group as
`whirlsplash.prompt.ps1`.
BREAKING CHANGE: `whirlsplash.prompt.ps1` configuration key created.
Diffstat (limited to 'src')
| -rw-r--r-- | src/config/Whirl.default.toml | 2 | ||||
| -rw-r--r-- | src/config/mod.rs | 6 | ||||
| -rw-r--r-- | src/prompt/mod.rs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/config/Whirl.default.toml b/src/config/Whirl.default.toml index 330a88b..072a7e8 100644 --- a/src/config/Whirl.default.toml +++ b/src/config/Whirl.default.toml @@ -2,11 +2,11 @@ worldsmaster_username = "WORLDSMASTER" # DO NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING log_level = 1 # Generally, you should only change this if you are experiencing issues ip = "0.0.0.0" # DO NOT CHANGE UNLESS YOU KNOW WHAT YOU ARE DOING -prompt_ps1 = "[WORLDSMASTER@Whirlsplash ~]$" api.port = 8080 [whirlsplash.prompt] enable = false +ps1 = "[WORLDSMASTER@Whirlsplash ~]$" [distributor] worldsmaster_greeting = "Welcome to Whirlsplash!" diff --git a/src/config/mod.rs b/src/config/mod.rs index a71020d..f86008e 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -8,7 +8,6 @@ pub struct WhirlsplashConfig { pub worldsmaster_username: String, pub log_level: i64, pub ip: String, - pub prompt_ps1: String, pub api: WhirlsplashApiConfig, pub prompt: WhirlsplashPromptConfig, } @@ -19,6 +18,7 @@ pub struct WhirlsplashApiConfig { #[derive(Serialize, Deserialize, Debug)] pub struct WhirlsplashPromptConfig { pub enable: bool, + pub ps1: String, } #[derive(Serialize, Deserialize, Debug)] pub struct DistributorConfig { @@ -63,12 +63,12 @@ impl Default for Config { worldsmaster_username: "WORLDSMASTER".to_string(), log_level: 1, ip: "0.0.0.0".to_string(), - prompt_ps1: "[WORLDSMASTER@Whirlsplash ~]$".to_string(), api: WhirlsplashApiConfig { port: 80 }, prompt: WhirlsplashPromptConfig { - enable: false + enable: false, + ps1: "[WORLDSMASTER@Whirlsplash ~]$".to_string(), }, }, distributor: DistributorConfig { diff --git a/src/prompt/mod.rs b/src/prompt/mod.rs index d1d08fa..9a94a44 100644 --- a/src/prompt/mod.rs +++ b/src/prompt/mod.rs @@ -33,7 +33,7 @@ impl Prompt { } fn write_prompt() { - print!("{} ", Config::get().whirlsplash.prompt_ps1); + print!("{} ", Config::get().whirlsplash.prompt.ps1); io::stdout().flush().unwrap(); } |