globgroups

Crates.ioglobgroups
lib.rsglobgroups
version0.1.0-beta.2
sourcesrc
created_at2024-03-18 01:14:58.753427
updated_at2024-03-18 19:28:17.312215
descriptionExpands groups like foo{a,b}
homepage
repositoryhttps://github.com/Techcable/globgroups.rust
max_upload_size
id1176932
size29,257
(Techcable)

documentation

README

globgroups

Expands glob groups like foo{bar,baz} -> ["foobar", "foobaz"]

Does not (currently) support wildcards like *.txt, because those are context-sensitive.

Examples

use globgroups::GlobExpr;

fn simple() {
    let glob: GlobExpr = "foo-{bar,baz}-suffix".parse().unwrap();
    assert_eq!(
        glob.expand().collect::<Vec<String>>(),
        vec![
            "foo-bar-suffix",
            "foo-baz-suffix"
        ]
    )
}

Notes

There is an old python version in misc/globgroups.py

Commit count: 4

cargo fmt