use std::io::Error; use std::path::PathBuf; use structopt::StructOpt; use preserves_schema::compiler::{CompilerConfig, compile, expand_inputs}; #[derive(Clone, StructOpt, Debug)] struct CommandLine { #[structopt(short, long)] output_dir: PathBuf, #[structopt(long)] prefix: String, #[structopt(long)] support_crate: Option, input_glob: Vec, } fn main() -> Result<(), Error> { let args = CommandLine::from_args(); let mut config = CompilerConfig::new(args.output_dir, args.prefix); if let Some(c) = args.support_crate { config.support_crate = c; } config.load_schemas_and_bundles(&expand_inputs(&args.input_glob)?)?; compile(&config) }