Crates.io | globgroups |
lib.rs | globgroups |
version | 0.1.0-beta.2 |
source | src |
created_at | 2024-03-18 01:14:58.753427 |
updated_at | 2024-03-18 19:28:17.312215 |
description | Expands groups like foo{a,b} |
homepage | |
repository | https://github.com/Techcable/globgroups.rust |
max_upload_size | |
id | 1176932 |
size | 29,257 |
Expands glob groups like foo{bar,baz}
-> ["foobar", "foobaz"]
Does not (currently) support wildcards like *.txt
,
because those are context-sensitive.
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"
]
)
}
There is an old python version in misc/globgroups.py