src-dst-clarifier

Crates.iosrc-dst-clarifier
lib.rssrc-dst-clarifier
version0.2.0
sourcesrc
created_at2023-05-03 10:24:46.751204
updated_at2023-05-06 11:06:53.486579
descriptionGive SRC and DST path, each may be a FILE or a DIR (even STDIO). Handle situations well and produce iterator over FILE-FILE pairs.
homepage
repositoryhttps://github.com/eternal-io/src-dst-clarifier
max_upload_size
id855264
size16,829
K--Aethiax (eternal-io)

documentation

https://docs.rs/src-dst-clarifier

README

SRC-DST-Clarifier

(WIP)

Give SRC and DST path, each may be a FILE or a DIR (even STDIO). Handle situations well and produce iterator over FILE-FILE pairs.

SrcDstConfig::new("png").parse("input.jpg", None);
// [./input.jpg => ./A01123-0456-0789.png]

SrcDstConfig::new("png").parse("input.jpg", Some("output.jpg"));
// [./input.jpg => ./output.jpg]

SrcDstConfig::new("png").parse("./frames", None);
// [./frames/0001.jpg   => ./A01123-0456-0789/0001.jpg]
// [./frames/0002.jpg   => ./A01123-0456-0789/0002.jpg]
// [./frames/0003.jpg   => ./A01123-0456-0789/0003.jpg]
//  ...
// [./frames/xxxx.jpg   => ./A01123-0456-0789/xxxx.jpg]

SrcDstConfig::new("png").parse("-", Some("-"));
// [<io::Stdin> => <io::Stdout>]

See documentation on docs.rs.

TODOs

  • Add wildcard matcher and (number) range filter to SRC.

    -i "./*.jpg"
    -i "./4???.jpg"
    -i "./{:04d}.jpg"
    -i "./{1..=999:04d}.jpg"
    
Commit count: 2

cargo fmt