reorganization
This commit is contained in:
parent
d1b43786bc
commit
cd008a024a
46
src/main.rs
46
src/main.rs
|
@ -11,25 +11,6 @@ use serde_json::Value;
|
||||||
|
|
||||||
use dirs;
|
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)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
struct Config {
|
struct Config {
|
||||||
pk_key: String,
|
pk_key: String,
|
||||||
|
@ -80,8 +61,26 @@ impl Fronters {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
const PK_URL: &str = "https://api.pluralkit.me/v2";
|
||||||
let helpstring = r#"PluralSync
|
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
|
Made by Jvnko@lavenderfield
|
||||||
|
|
||||||
Usage:\npluralsync [COMMAND] [member1] [member2]...
|
Usage:\npluralsync [COMMAND] [member1] [member2]...
|
||||||
|
@ -93,6 +92,7 @@ get - Refreshes the current front information
|
||||||
add - Adds a member to the existing front
|
add - Adds a member to the existing front
|
||||||
memberlist - Shows loaded member list"#;
|
memberlist - Shows loaded member list"#;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
if std::env::args().len() > 1 {
|
if std::env::args().len() > 1 {
|
||||||
let augs: Vec<String> = std::env::args().collect();
|
let augs: Vec<String> = std::env::args().collect();
|
||||||
let command = &augs[1];
|
let command = &augs[1];
|
||||||
|
@ -125,13 +125,13 @@ memberlist - Shows loaded member list"#;
|
||||||
let _ = get(config_path);
|
let _ = get(config_path);
|
||||||
},
|
},
|
||||||
"memberlist" => memberlist(config_path),
|
"memberlist" => memberlist(config_path),
|
||||||
&_ => println!("{}", helpstring),
|
&_ => println!("{}", HELP_STRING),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => println!("Something went wrong")
|
None => println!("Something went wrong")
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println!("{}", helpstring);
|
println!("{}", HELP_STRING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue