A barebones configuration file made for low-dependency rust applications.
Add to your Cargo.toml
file:
toml
[dependancies]
superconf = "0.2"
Default seperator (space ) demonstration:
```rust use superconf::parse_str;
let input = "mykey myvalue";
println!("Outputted HashMap: {:#?}", parse_str(input).unwrap()); ```
Or if you'd like to use a custom seperator like :
or =
:
```rust use superconf::parsecustomsep;
let inputequal = "custom=seperator"; let inputcolon = "second:string";
println!("Equals seperator: {:#?}", parsecustomsep(inputequal, '=').unwrap()); println!("Colon seperator: {:#?}", parsecustomsep(inputcolon, ':').unwrap()); ```
Here is a complete syntax demonstration:
```none
mykey thevalue
your_path /home/user/Cool Path/x.txt
otherkey inlevel seeitis second_level another level ```
Some conventions commonly used for superconf files:
snake_case
.super
file extensionMade this as a quick custom parser to challenge myself a bit and to use for a quick-n-dirty configuration format in the future. It's not the best file format in the world but it gets the job done.