Skip to content

A Rust library and CLI tool for parsing and formatting config files from source engine games.

License

Notifications You must be signed in to change notification settings

ubbemir/sourcecfg-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sourcecfg-rs

A Rust library and CLI tool for parsing and formatting config files from source engine games.

Usage

Compile and run the formatter using either cargo directly by invoking cargo run -- <params to sourcecfg_fmt> or by first compiling the program using cargo build --release and using the produced binary found in: target/release.

Library usage

As of now the project is not on crates.io so to include it in your package you can add the dependency to Cargo.toml like this:

[dependencies]
sourcecfg-rs = { git = "https://github.com/ubbemir/sourcecfg-rs" }

Example usage of a formatter:

use sourcecfg_rs::{formatters, parser};

let config = parser::parse("mp_restartgame 1; sv_cheats 0").expect("Failed to parse CFG");
println!("{}", formatters::prettify(&config));

About

A Rust library and CLI tool for parsing and formatting config files from source engine games.

Resources

License

Stars

Watchers

Forks

Languages