1use clap::Parser;
2use std::io::{stdin, Read};
3use std::process;
4
5use dns_types::zones::types::Zone;
6
7#[derive(Parser)]
9struct Args {}
14
15fn main() {
16 Args::parse();
17
18 let mut buf = String::new();
19 if let Err(err) = stdin().read_to_string(&mut buf) {
20 eprintln!("error reading zone file from stdin: {err:?}");
21 process::exit(1);
22 }
23
24 match Zone::deserialise(&buf) {
25 Ok(zone) => print!("{}", zone.serialise()),
26 Err(err) => {
27 eprintln!("error parsing zone file from stdin: {err:?}");
28 process::exit(1);
29 }
30 }
31}