blob: 0abe2f5ef9f755dba9dadf156c22581cedd22a9f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
use anyhow::Context;
use std::path::{Path, PathBuf};
use structopt::StructOpt;
use summain::ManifestEntry;
fn main() -> anyhow::Result<()> {
let mut opt = Opt::from_args();
opt.pathnames[..].sort();
for pathname in opt.pathnames {
report(&pathname).with_context(|| format!("{}", pathname.display()))?
}
Ok(())
}
#[derive(StructOpt, Debug)]
struct Opt {
#[structopt(parse(from_os_str))]
pathnames: Vec<PathBuf>,
}
fn report(pathname: &Path) -> anyhow::Result<()> {
let e = ManifestEntry::new(pathname)?;
println!("{}", serde_yaml::to_string(&e)?);
Ok(())
}
|