1use clap::Parser;
2use std::io::{stdin, Read};
3use std::process;
4
5use dns_types::hosts::types::Hosts;
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 hosts file from stdin: {err:?}");
21 process::exit(1);
22 }
23
24 match Hosts::deserialise(&buf) {
25 Ok(hosts) => print!("{}", hosts.serialise()),
26 Err(err) => {
27 eprintln!("error parsing hosts file from stdin: {err:?}");
28 process::exit(1);
29 }
30 }
31}