From cd008a024ae5b19e7d7956b63edffacf7b6a1fa2 Mon Sep 17 00:00:00 2001 From: Junko Date: Mon, 27 Nov 2023 08:42:45 +0100 Subject: [PATCH] reorganization --- src/main.rs | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3844a7f..eaf44da 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,25 +11,6 @@ use serde_json::Value; use dirs; -const PK_URL: &str = "https://api.pluralkit.me/v2"; -const SP_URL: &str = "https://api.apparyllis.com/v1"; - -const EXAMPLE_JSON: &str = r#"{ - "pk_key": "// Pluralkit token", - "sp_key": "// Simplplural token", - "pfp_module": { - "enabled": false, - "pfp_folder": "// Folder to grab profile pictures, they follow they member1member2.png format", - "pfp_output_path": "// Path for the copied selected pfp" - }, - "disc_module": { - "enabled": false, - "token": "// Discord user token", - "python_path": "// Path of the python executable", - "script_path": "// Path of the pfp changer python script" - } -}"#; - #[derive(Debug, Serialize, Deserialize)] struct Config { pk_key: String, @@ -80,8 +61,26 @@ impl Fronters { } } -fn main() { - let helpstring = r#"PluralSync +const PK_URL: &str = "https://api.pluralkit.me/v2"; +const SP_URL: &str = "https://api.apparyllis.com/v1"; + +const EXAMPLE_JSON: &str = r#"{ + "pk_key": "// Pluralkit token", + "sp_key": "// Simplplural token", + "pfp_module": { + "enabled": false, + "pfp_folder": "// Folder to grab profile pictures, they follow they member1member2.png format", + "pfp_output_path": "// Path for the copied selected pfp" + }, + "disc_module": { + "enabled": false, + "token": "// Discord user token", + "python_path": "// Path of the python executable", + "script_path": "// Path of the pfp changer python script" + } +}"#; + +const HELP_STRING: &str = r#"PluralSync Made by Jvnko@lavenderfield Usage:\npluralsync [COMMAND] [member1] [member2]... @@ -93,6 +92,7 @@ get - Refreshes the current front information add - Adds a member to the existing front memberlist - Shows loaded member list"#; +fn main() { if std::env::args().len() > 1 { let augs: Vec = std::env::args().collect(); let command = &augs[1]; @@ -125,13 +125,13 @@ memberlist - Shows loaded member list"#; let _ = get(config_path); }, "memberlist" => memberlist(config_path), - &_ => println!("{}", helpstring), + &_ => println!("{}", HELP_STRING), } }, None => println!("Something went wrong") } } else { - println!("{}", helpstring); + println!("{}", HELP_STRING); } }