diff --git a/Cargo.lock b/Cargo.lock index b79a1b8..ca7c9b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "base64" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" + [[package]] name = "bitflags" version = "1.3.2" @@ -135,6 +141,8 @@ dependencies = [ "glob", "notify", "notify-debouncer-mini", + "ron", + "serde", "termion", ] @@ -411,6 +419,17 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "ron" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" +dependencies = [ + "base64", + "bitflags", + "serde", +] + [[package]] name = "same-file" version = "1.0.6" @@ -420,6 +439,26 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "serde" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.144" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "strsim" version = "0.10.0" diff --git a/Cargo.toml b/Cargo.toml index 226c89d..17fbad1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,4 +13,6 @@ clap = { version = "3.2.22", features = ["clap_derive", "derive"] } glob = "0.3.0" notify = "5.0.0" notify-debouncer-mini = "0.2.1" +ron = "0.8.0" +serde = { version = "1.0.144", features = ["derive"] } termion = "1.5.6" diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..2d29c7b --- /dev/null +++ b/src/config.rs @@ -0,0 +1,21 @@ +pub struct UserConfig { + main_file: Option, + test_file: Option, + includes: Option>, +} + +pub struct Config { + main_file: String, + test_file: String, + includes: Vec, +} + +impl Default for Config { + fn default() -> Self { + Self { + main_file: "main.c".into(), + test_file: "test.c".into(), + includes: vec![], + } + } +} diff --git a/src/main.rs b/src/main.rs index f3d0915..c3514ba 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,7 @@ use clap::{Parser, Subcommand}; pub mod check; +pub mod config; pub mod run; pub mod tasks; pub mod test;