From d07d2ed61b7de1d191eb7ef0a149246d52937d69 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 9 Jun 2021 12:18:17 +0000 Subject: refactor(config): rename `Whirl.toml` to `Config.toml` Since the configuration file is in the `.whirl` directory, it is redundant to have it's name still as `Whirl.toml` BREAKING CHANGE: Configuration file is renamed --- .gitignore | 4 +++- .whirl/Config.example.toml | 24 ++++++++++++++++++++++++ .whirl/Whirl.example.toml | 24 ------------------------ crates/whirl_config/Config.default.toml | 24 ++++++++++++++++++++++++ crates/whirl_config/Whirl.default.toml | 24 ------------------------ crates/whirl_config/src/lib.rs | 2 +- crates/whirl_prompt/src/builtins/constants.rs | 2 +- crates/whirl_prompt/src/builtins/mod.rs | 2 +- 8 files changed, 54 insertions(+), 52 deletions(-) create mode 100644 .whirl/Config.example.toml delete mode 100644 .whirl/Whirl.example.toml create mode 100644 crates/whirl_config/Config.default.toml delete mode 100644 crates/whirl_config/Whirl.default.toml diff --git a/.gitignore b/.gitignore index 3904a26..eb41bc2 100644 --- a/.gitignore +++ b/.gitignore @@ -15,9 +15,11 @@ Cargo.lock # Development /src/_*.* -/.whirl/ /.secrets /crates/**/target/ +/.whirl/log/ +/.whirl/Config.toml +/.whirl/whirl.sqlite3 # Wireshark *.pcapng diff --git a/.whirl/Config.example.toml b/.whirl/Config.example.toml new file mode 100644 index 0000000..aa2d684 --- /dev/null +++ b/.whirl/Config.example.toml @@ -0,0 +1,24 @@ +# See more keys and their definitions at https://whirlsplash.org/docs/whirl/configuration + +[whirlsplash] +worldsmaster_username = "WORLDSMASTER" +ip = "0.0.0.0" +api.port = 8080 + +[whirlsplash.prompt] +enable = false +ps1 = "[WORLDSMASTER@Whirlsplash ~]$" + +[whirlsplash.log] +enable = true +level = 1 +everything = false +test = false +file = true + +[distributor] +worldsmaster_greeting = "Welcome to Whirlsplash!" +port = 6650 + +[hub] +port = 5673 diff --git a/.whirl/Whirl.example.toml b/.whirl/Whirl.example.toml deleted file mode 100644 index aa2d684..0000000 --- a/.whirl/Whirl.example.toml +++ /dev/null @@ -1,24 +0,0 @@ -# See more keys and their definitions at https://whirlsplash.org/docs/whirl/configuration - -[whirlsplash] -worldsmaster_username = "WORLDSMASTER" -ip = "0.0.0.0" -api.port = 8080 - -[whirlsplash.prompt] -enable = false -ps1 = "[WORLDSMASTER@Whirlsplash ~]$" - -[whirlsplash.log] -enable = true -level = 1 -everything = false -test = false -file = true - -[distributor] -worldsmaster_greeting = "Welcome to Whirlsplash!" -port = 6650 - -[hub] -port = 5673 diff --git a/crates/whirl_config/Config.default.toml b/crates/whirl_config/Config.default.toml new file mode 100644 index 0000000..aa2d684 --- /dev/null +++ b/crates/whirl_config/Config.default.toml @@ -0,0 +1,24 @@ +# See more keys and their definitions at https://whirlsplash.org/docs/whirl/configuration + +[whirlsplash] +worldsmaster_username = "WORLDSMASTER" +ip = "0.0.0.0" +api.port = 8080 + +[whirlsplash.prompt] +enable = false +ps1 = "[WORLDSMASTER@Whirlsplash ~]$" + +[whirlsplash.log] +enable = true +level = 1 +everything = false +test = false +file = true + +[distributor] +worldsmaster_greeting = "Welcome to Whirlsplash!" +port = 6650 + +[hub] +port = 5673 diff --git a/crates/whirl_config/Whirl.default.toml b/crates/whirl_config/Whirl.default.toml deleted file mode 100644 index aa2d684..0000000 --- a/crates/whirl_config/Whirl.default.toml +++ /dev/null @@ -1,24 +0,0 @@ -# See more keys and their definitions at https://whirlsplash.org/docs/whirl/configuration - -[whirlsplash] -worldsmaster_username = "WORLDSMASTER" -ip = "0.0.0.0" -api.port = 8080 - -[whirlsplash.prompt] -enable = false -ps1 = "[WORLDSMASTER@Whirlsplash ~]$" - -[whirlsplash.log] -enable = true -level = 1 -everything = false -test = false -file = true - -[distributor] -worldsmaster_greeting = "Welcome to Whirlsplash!" -port = 6650 - -[hub] -port = 5673 diff --git a/crates/whirl_config/src/lib.rs b/crates/whirl_config/src/lib.rs index 47b26a8..93328ca 100644 --- a/crates/whirl_config/src/lib.rs +++ b/crates/whirl_config/src/lib.rs @@ -59,7 +59,7 @@ impl Config { fn load() -> Result { let mut s = config::Config::new(); - s.merge(File::with_name(".whirl/Whirl.toml").required(false))?; + s.merge(File::with_name(".whirl/Config.toml").required(false))?; s.try_into() } diff --git a/crates/whirl_prompt/src/builtins/constants.rs b/crates/whirl_prompt/src/builtins/constants.rs index e87cceb..8ba67bc 100644 --- a/crates/whirl_prompt/src/builtins/constants.rs +++ b/crates/whirl_prompt/src/builtins/constants.rs @@ -1,7 +1,7 @@ // Copyleft (ɔ) 2021-2021 The Whirlsplash Collective // SPDX-License-Identifier: GPL-3.0-only -pub const FILES: [&str; 2] = ["README.rst", "Whirl.toml"]; +pub const FILES: [&str; 2] = ["README.rst", "Config.toml"]; pub const HELPABLES_BUILTINS: [&str; 8] = [ "cat - display the contents of a present file", "config - manipulate the configuration", diff --git a/crates/whirl_prompt/src/builtins/mod.rs b/crates/whirl_prompt/src/builtins/mod.rs index 655f507..db9cb64 100644 --- a/crates/whirl_prompt/src/builtins/mod.rs +++ b/crates/whirl_prompt/src/builtins/mod.rs @@ -64,7 +64,7 @@ pub fn builtin_cat(args: &[String]) -> i32 { .unwrap(); transfer.perform().unwrap(); } - "Whirl.toml" => { + "Config.toml" => { colour::red_ln!("NOTE: This is just a wrapper for `config show`."); println!("{:#?}", Config::get()); } -- cgit v1.2.3