1 unstable release
0.1.0 | May 5, 2019 |
---|
#20 in #regex-parser
9KB
143 lines
Gitmodules
Gitmodules is a simple parser for reading .gitmodules
files.
Gitmodules is a simple Regex based parsing library for reading the .gitmodules file of a Git repository.
Documentation
Module documentation with examples.
License
Gitmodules is licensed under either the
- Apache License, Version 2.0 (LICENSE-APACHE / http://www.apache.org/licenses/LICENSE-2.0)
or the
- MIT license (LICENSE-MIT / http://opensource.org/licenses/MIT).
lib.rs
:
This crate provides a simple regular expression based parsing library
for reading the .gitmodules
file of a Git repository.
Usage
Add this to your Cargo.toml
:
[dependencies]
gitmodules = "0.1"
Usage is trivial:
use std::io::BufReader;
use gitmodules::{read_gitmodules, Submodule};
fn demo() {
let text = r#"
[submodule "foo"]
path = "some/path"
"#
.as_bytes();
let text = BufReader::new(text);
let submodules = read_gitmodules(text).unwrap();
println!("Submodule name {}", submodules.first().unwrap().name());
}
Dependencies
~2.2–3MB
~55K SLoC