#git #git-repository #regex-parser #reading #file

gitmodules

A simple regex based parsing library for reading the .gitmodules file of a Git repository

1 unstable release

0.1.0 May 5, 2019

#20 in #regex-parser

MIT/Apache

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

or the


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